From: MirceaKitsune Date: Mon, 10 Jun 2013 21:13:27 +0000 (+0300) Subject: Get VoreTournament code to compile with gmqcc. To be compiled with the same parameter... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b2df32d96df3e954d54f6e4b9bbb6c98d77ef507;p=voretournament%2Fvoretournament.git Get VoreTournament code to compile with gmqcc. To be compiled with the same parameters as Xonotic (makefile to come). This likely breaks fteqcc support! --- diff --git a/data/qcsrc/client/Defs.qc b/data/qcsrc/client/Defs.qc index e9ba774f..143b9af5 100644 --- a/data/qcsrc/client/Defs.qc +++ b/data/qcsrc/client/Defs.qc @@ -1,6 +1,3 @@ -#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed - - //NOTE: THIS IS AN INTERFACE FILE. DO NOT EDIT. //MODIFYING THIS FILE CAN RESULT IN CRC ERRORS. //YOU HAVE BEEN WARNED. diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index b1ae0350..84e69a5b 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -33,9 +33,8 @@ void() menu_show_error = // CSQC_Init : Called every time the CSQC code is initialized (essentially at map load) // Useful for precaching things -void() menu_sub_null = -{ -}; +float(float, float, float) menu_sub_null_float = { }; +void () menu_sub_null_void = { }; #ifdef USE_FTE float __engine_check; @@ -71,7 +70,7 @@ void CSQC_Init(void) drawfont = FONT_USER+1; menu_visible = FALSE; menu_show = menu_show_error; - menu_action = menu_sub_null; + menu_action = menu_sub_null_float; for(i = 0; i < 255; ++i) if(getplayerkey(i, "viewentity") == "") @@ -972,8 +971,8 @@ void Ent_Remove() self.enttype = 0; self.classname = ""; - self.draw = menu_sub_null; - self.entremove = menu_sub_null; + self.draw = menu_sub_null_void; + self.entremove = menu_sub_null_void; // TODO possibly set more stuff to defaults } // CSQC_Ent_Remove : Called when the server requests a SSQC / CSQC entity to be removed. Essentially call remove(self) as well. diff --git a/data/qcsrc/client/csqc_builtins.qc b/data/qcsrc/client/csqc_builtins.qc index c5ba47e9..2736feb0 100644 --- a/data/qcsrc/client/csqc_builtins.qc +++ b/data/qcsrc/client/csqc_builtins.qc @@ -3,7 +3,6 @@ void(entity e, vector o) setorigin = #2; void (entity e, string m) setmodel = #3; void(entity e, vector min, vector max) setsize = #4; -void () break = #6; float () random = #7; void (entity e, float chan, string samp, float vol, float atten) sound = #8; vector (vector v) normalize = #9; diff --git a/data/qcsrc/client/ctf.qc b/data/qcsrc/client/ctf.qc index 63b639a1..9b6374d4 100644 --- a/data/qcsrc/client/ctf.qc +++ b/data/qcsrc/client/ctf.qc @@ -12,7 +12,7 @@ void() menu_close = { menu_visible = false; menu_show = menu_show_error; - menu_action = menu_sub_null; + menu_action = menu_sub_null_float; /*if(ctf_temp_1) strunzone(ctf_temp_1);*/ diff --git a/data/qcsrc/client/main.qh b/data/qcsrc/client/main.qh index e16c1088..5d879949 100644 --- a/data/qcsrc/client/main.qh +++ b/data/qcsrc/client/main.qh @@ -1,5 +1,3 @@ -const string string_null; - // -------------------------------------------------------------------------- // MENU Functionality @@ -11,7 +9,8 @@ const string string_null; #define DATABUF_NEXT (5*maxclients) void() menu_show_error; -void() menu_sub_null; +float(float, float, float) menu_sub_null_float; +void () menu_sub_null_void; float menu_visible; var void() menu_show; diff --git a/data/qcsrc/client/miscfunctions.qc b/data/qcsrc/client/miscfunctions.qc index 687f8a2c..dcbeca3e 100644 --- a/data/qcsrc/client/miscfunctions.qc +++ b/data/qcsrc/client/miscfunctions.qc @@ -1,4 +1,4 @@ -var float(string text, float handleColors, vector fontSize) stringwidth; +float(string text, float handleColors, vector fontSize) stringwidth; entity players; entity teams; diff --git a/data/qcsrc/common/gamecommand.qc b/data/qcsrc/common/gamecommand.qc index a5cab595..50990c91 100644 --- a/data/qcsrc/common/gamecommand.qc +++ b/data/qcsrc/common/gamecommand.qc @@ -828,7 +828,7 @@ float GameCommand_Generic(string command) return TRUE; } else if(argv(0) == "records") { - print(records_reply); + //print(records_reply); I HAVE NO CLUE HOW TO FIX THIS! return TRUE; } else if(argv(0) == "rankings") { diff --git a/data/qcsrc/common/mapinfo.qc b/data/qcsrc/common/mapinfo.qc index 5f58477e..f31bc532 100644 --- a/data/qcsrc/common/mapinfo.qc +++ b/data/qcsrc/common/mapinfo.qc @@ -38,7 +38,7 @@ void MapInfo_Cache_Store() return; s = db_get(_MapInfo_Cache_DB_NameToIndex, MapInfo_Map_bspname); - if(!s) // empty string is NOT valid here! + if(s == "") { i = buf_getsize(_MapInfo_Cache_Buf_IndexToMapData); db_put(_MapInfo_Cache_DB_NameToIndex, MapInfo_Map_bspname, ftos(i)); @@ -64,7 +64,7 @@ float MapInfo_Cache_Retrieve(string map) return 0; s = db_get(_MapInfo_Cache_DB_NameToIndex, map); - if(!s) + if(s == "") return 0; i = stof(s); @@ -76,6 +76,7 @@ float MapInfo_Cache_Retrieve(string map) MapInfo_Map_supportedGametypes = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i)); MapInfo_Map_supportedFeatures = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i)); MapInfo_Map_flags = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i)); + return 1; } @@ -86,6 +87,8 @@ float _MapInfo_globhandle; string _MapInfo_GlobItem(float i) { string s; + if(!_MapInfo_globopen) + return string_null; s = search_getfilename(_MapInfo_globhandle, i); return substring(s, 5, strlen(s) - 9); // without maps/ and .bsp } @@ -93,11 +96,19 @@ string _MapInfo_GlobItem(float i) void MapInfo_Enumerate() { if(_MapInfo_globopen) + { search_end(_MapInfo_globhandle); + _MapInfo_globopen = 0; + } MapInfo_Cache_Invalidate(); _MapInfo_globhandle = search_begin("maps/*.bsp", TRUE, TRUE); - _MapInfo_globcount = search_getsize(_MapInfo_globhandle); - _MapInfo_globopen = 1; + if(_MapInfo_globhandle >= 0) + { + _MapInfo_globcount = search_getsize(_MapInfo_globhandle); + _MapInfo_globopen = 1; + } + else + _MapInfo_globcount = 0; } // filter the info by game type mask (updates MapInfo_count) diff --git a/data/qcsrc/common/util.qh b/data/qcsrc/common/util.qh index ec704494..97298d89 100644 --- a/data/qcsrc/common/util.qh +++ b/data/qcsrc/common/util.qh @@ -5,7 +5,7 @@ #define func __merge__##otherfunc \ #else \ #define func otherfunc \ - #endif + #endif \ // this returns a tempstring containing a copy of s with additional \n newlines added, it also replaces \n in the text with a real newline // NOTE: s IS allowed to be a tempstring @@ -15,7 +15,7 @@ string wordwrap(string s, float l); void wordwrap_sprint(string s, float l); #endif #endif -void wordwrap_cb(string s, float l, void(string) callback) +void wordwrap_cb(string s, float l, void(string) callback); #ifndef SVQC string draw_currentSkin; @@ -111,7 +111,11 @@ vector mi_pictexcoord3; // texcoords of the image corners (after transforming, t void get_mi_min_max_texcoords(float mode); #endif +#ifndef GMQCC #define FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(x) void reference_##x() { x = x; } +#else +#define FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(x) +#endif float almost_equals(float a, float b); float almost_in_bounds(float a, float b, float c); @@ -192,8 +196,15 @@ void WriteInt24_t(float dest, float val); #endif // the NULL function -const var void func_null(void); FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(func_null) -const var string string_null; +#ifdef GMQCC +#define null nil +#define func_null nil +#define string_null nil +#else +#define null SUB_null +var void func_null(void); +var string string_null; +#endif float float2range11(float f); float float2range01(float f); diff --git a/data/qcsrc/menu/item/button.c b/data/qcsrc/menu/item/button.c index a3753c5f..ea4f2ac2 100644 --- a/data/qcsrc/menu/item/button.c +++ b/data/qcsrc/menu/item/button.c @@ -8,7 +8,7 @@ CLASS(Button) EXTENDS(Label) METHOD(Button, mousePress, float(entity, vector)) METHOD(Button, mouseDrag, float(entity, vector)) METHOD(Button, mouseRelease, float(entity, vector)) - ATTRIB(Button, onClick, void(entity, entity), SUB_Null) + ATTRIB(Button, onClick, void(entity, entity), func_null) ATTRIB(Button, onClickEntity, entity, NULL) ATTRIB(Button, src, string, string_null) ATTRIB(Button, srcSuffix, string, string_null) @@ -169,4 +169,4 @@ void drawButton(entity me) else if(!me.focused && me.playedfocus) me.playedfocus = 0; } -#endif \ No newline at end of file +#endif diff --git a/data/qcsrc/menu/menu.qc b/data/qcsrc/menu/menu.qc index fb10fa3e..1260f858 100644 --- a/data/qcsrc/menu/menu.qc +++ b/data/qcsrc/menu/menu.qc @@ -18,7 +18,7 @@ float menuMouseMode; void SUB_Null() { }; -void() m_init = +void m_init() { localcmd("maxplayers $menu_maxplayers\n"); // make sure maxplayers is set if we start a game with the map command cvar_set("_menu_alpha", "0"); @@ -91,7 +91,7 @@ void UpdateConWidthHeight() } } -void() m_init_delayed = +void m_init_delayed() { float fh, glob, n, i; string s; @@ -163,7 +163,7 @@ void() m_init_delayed = m_display(); // delayed menu display }; -void(float key, float ascii) m_keyup = +void m_keyup (float key, float ascii) { if(!menuInitialized) return; @@ -187,7 +187,7 @@ void(float key, float ascii) m_keyup = if(key == K_SHIFT) menuShiftState -= (menuShiftState & S_SHIFT); }; -void(float key, float ascii) m_keydown = +void m_keydown (float key, float ascii) { if(!menuInitialized) return; @@ -264,7 +264,7 @@ void draw_Picture_Aligned(vector algn, float scalemode, string img, float a) draw_Picture(org, img, isz, '1 1 1', a); } -void(string img, float a, string algn, float force1) drawBackground = +void drawBackground (string img, float a, string algn, float force1) { vector v; float i, l; @@ -533,7 +533,7 @@ void m_tooltip(vector pos) } } -void() m_draw = +void m_draw() { float t; float realFrametime; @@ -707,7 +707,7 @@ void() m_draw = frametime = 0; }; -void() m_display = +void m_display() { Menu_Active = true; setkeydest(KEY_MENU); @@ -724,7 +724,7 @@ void() m_display = main.showNotify(main); }; -void() m_hide = +void m_hide() { Menu_Active = false; setkeydest(KEY_GAME); @@ -737,7 +737,7 @@ void() m_hide = main.hideNotify(main); }; -void() m_toggle = +void m_toggle() { if(Menu_Active) m_hide(); @@ -745,7 +745,7 @@ void() m_toggle = m_display(); }; -void() m_shutdown = +void m_shutdown() { entity e; @@ -811,7 +811,7 @@ void m_setpointerfocus(entity wnd) } } -void(string itemname) m_goto = +void m_goto(string itemname) { entity e; if(!menuInitialized) @@ -839,7 +839,7 @@ void(string itemname) m_goto = } } -void() m_goto_skin_selector = +void m_goto_skin_selector() { if(!menuInitialized) return; @@ -847,7 +847,7 @@ void() m_goto_skin_selector = m_goto("skinselector"); } -void() m_goto_video_settings = +void m_goto_video_settings() { if(!menuInitialized) return; diff --git a/data/qcsrc/menu/msys.qh b/data/qcsrc/menu/msys.qh index 2c57a9d2..54a6e1be 100644 --- a/data/qcsrc/menu/msys.qh +++ b/data/qcsrc/menu/msys.qh @@ -1,5 +1,3 @@ -#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed - ////////////////////////////////////////////////////////// // sys globals diff --git a/data/qcsrc/menu/oo/constructors.h b/data/qcsrc/menu/oo/constructors.h index 5de8560c..bf075eda 100644 --- a/data/qcsrc/menu/oo/constructors.h +++ b/data/qcsrc/menu/oo/constructors.h @@ -19,5 +19,5 @@ #define EXTENDS(base) me = spawn##base (); #define METHOD(cname,name,prototype) me.name = name##cname; #define ATTRIB(cname,name,type,val) me.name = val; -#define ATTRIBARRAY(cname,name,type,cnt) me.name = me.name; +#define ATTRIBARRAY(cname,name,type,cnt) #define ENDCLASS(cname) me.instanceOf##cname = 1; me.classname = #cname; return me; } diff --git a/data/qcsrc/menu/skin-customizables.inc b/data/qcsrc/menu/skin-customizables.inc index a17b7c06..9bd2c5d8 100644 --- a/data/qcsrc/menu/skin-customizables.inc +++ b/data/qcsrc/menu/skin-customizables.inc @@ -6,7 +6,7 @@ print "\n"; while() { chomp; - if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/) + if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/) #' { printf "%-31s %s\n", $1, $2; } diff --git a/data/qcsrc/menu/skin.qh b/data/qcsrc/menu/skin.qh index e12e5aa2..142156ce 100644 --- a/data/qcsrc/menu/skin.qh +++ b/data/qcsrc/menu/skin.qh @@ -17,7 +17,7 @@ //#define SKINSTRING(name,def) case #name: break #define SKINSTRING(name,def) case #name: SKIN##name = strzone(value); break // I know this leaks memory when skin is read multiple times. Screw it. -#define SKINEND case "": break; case "//": break; default: print("Invalid key in skin file: ", key, "\n"); } } +#define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } } #include "skin-customizables.inc" #undef SKINEND #undef SKINSTRING diff --git a/data/qcsrc/menu/voret/inputbox.c b/data/qcsrc/menu/voret/inputbox.c index 9c10b2b1..4acac9f5 100644 --- a/data/qcsrc/menu/voret/inputbox.c +++ b/data/qcsrc/menu/voret/inputbox.c @@ -5,9 +5,9 @@ CLASS(VoretInputBox) EXTENDS(InputBox) METHOD(VoretInputBox, setText, void(entity, string)) ATTRIB(VoretInputBox, fontSize, float, SKINFONTSIZE_NORMAL) ATTRIB(VoretInputBox, image, string, SKINGFX_INPUTBOX) - ATTRIB(VoretInputBox, onChange, void(entity, entity), SUB_Null) + ATTRIB(VoretInputBox, onChange, void(entity, entity), func_null) ATTRIB(VoretInputBox, onChangeEntity, entity, NULL) - ATTRIB(VoretInputBox, onEnter, void(entity, entity), SUB_Null) + ATTRIB(VoretInputBox, onEnter, void(entity, entity), func_null) ATTRIB(VoretInputBox, onEnterEntity, entity, NULL) ATTRIB(VoretInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS) ATTRIB(VoretInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS) @@ -53,7 +53,8 @@ void setTextVoretInputBox(entity me, string new) if(me.text != new) { setTextInputBox(me, new); - me.onChange(me, me.onChangeEntity); + if(me.onChange) + me.onChange(me, me.onChangeEntity); } else setTextInputBox(me, new); diff --git a/data/qcsrc/server/antilag.qc b/data/qcsrc/server/antilag.qc index 48cf4d71..5f06458b 100644 --- a/data/qcsrc/server/antilag.qc +++ b/data/qcsrc/server/antilag.qc @@ -8,8 +8,8 @@ void antilag_dummy() { - self.antilag_times = 0; - self.antilag_origins = '0 0 0'; + self.antilag_times[0] = 0; + self.antilag_origins[0] = '0 0 0'; } void antilag_record(entity e, float t) diff --git a/data/qcsrc/server/bot/havocbot/havocbot.qc b/data/qcsrc/server/bot/havocbot/havocbot.qc index 20b22a69..72adda8a 100644 --- a/data/qcsrc/server/bot/havocbot/havocbot.qc +++ b/data/qcsrc/server/bot/havocbot/havocbot.qc @@ -1034,7 +1034,7 @@ void havocbot_chooseweapon() } } -#ifdef 0 +#if 0 // TODO: This disabled code is not working well and got replaced by custom weapon priorities. // However, this logic should be refactored and moved to weapons code so each new weapon can be // evaluated dynamically by bots without updating the "ai" or config files. --mand1nga diff --git a/data/qcsrc/server/bot/scripting.qc b/data/qcsrc/server/bot/scripting.qc index ca7e37ec..20229da3 100644 --- a/data/qcsrc/server/bot/scripting.qc +++ b/data/qcsrc/server/bot/scripting.qc @@ -67,12 +67,13 @@ float bot_havecommand(entity bot, float idx) .string bot_placenames[MAX_BOT_PLACES]; entity bot_getplace(string placename) { + string s; entity e; if(substring(placename, 0, 1) == "@") { float i, p; placename = substring(placename, 1, -1); - string s, s2; + string s2; for(i = 0; i < self.bot_places_count; ++i) if(self.(bot_placenames[i]) == placename) return self.(bot_places[i]); diff --git a/data/qcsrc/server/cl_physics.qc b/data/qcsrc/server/cl_physics.qc index d3aa8e51..40ab462f 100644 --- a/data/qcsrc/server/cl_physics.qc +++ b/data/qcsrc/server/cl_physics.qc @@ -339,10 +339,9 @@ void RaceCarPhysics() self.angles_z = 0; makevectors(self.angles); // new forward direction! + float myspeed, upspeed, steerfactor, accelfactor; if(self.flags & FL_ONGROUND || g_bugrigs_air_steering) { - float myspeed, upspeed, steerfactor, accelfactor; - myspeed = self.velocity * v_forward; upspeed = self.velocity * v_up; diff --git a/data/qcsrc/server/cl_player.qc b/data/qcsrc/server/cl_player.qc index 4ee6f9b9..1fe073a2 100644 --- a/data/qcsrc/server/cl_player.qc +++ b/data/qcsrc/server/cl_player.qc @@ -923,12 +923,12 @@ void Say(entity source, float teamsay, entity privatesay, string msgin, float fl // FLOOD CONTROL flood = 0; + var .float flood_field; if(floodcontrol) { float flood_spl; float flood_burst; float flood_lmax; - var .float flood_field; float lines; if(privatesay) { @@ -982,8 +982,10 @@ void Say(entity source, float teamsay, entity privatesay, string msgin, float fl } } - if (timeoutStatus == 2) //when game is paused, no flood protection - source.flood_field = flood = 0; + if (timeoutStatus == 2) { //when game is paused, no flood protection + source.flood_field = 0; + flood = 0; + } if(flood == 2) { @@ -1204,8 +1206,8 @@ void UpdatePlayerSounds() self.skin_for_playersound = self.skin; ClearPlayerSounds(); LoadPlayerSounds("sound/player/default.sounds", 1); - if not(LoadPlayerSounds(strcat(self.model, "_", ftos(self.skin), ".", "sounds"), 0)) - LoadPlayerSounds(strcat(self.model, ".", "sounds"), 0); + LoadPlayerSounds(strcat(self.model, "_", ftos(self.skin), ".", "sounds"), 0); + LoadPlayerSounds(strcat(self.model, ".", "sounds"), 0); } void GlobalSound(string sample, float chan, float voicetype, float vol) diff --git a/data/qcsrc/server/func_breakable.qc b/data/qcsrc/server/func_breakable.qc index 34ad1f3c..e4921123 100644 --- a/data/qcsrc/server/func_breakable.qc +++ b/data/qcsrc/server/func_breakable.qc @@ -110,8 +110,14 @@ void func_breakable_look_restore() void func_breakable_behave_destroyed() { self.health = self.max_health; - self.takedamage = DAMAGE_NO; - self.event_damage = SUB_Null; + #ifndef GMQCC + self.event_damage = SUB_Null; + self.takedamage = DAMAGE_NO; + #else + // GMQCCs NIL keyword is the BOMB! + self.event_damage = nil; + self.takedamage = nil; + #endif self.state = 1; setsize(self, '0 0 0', '0 0 0'); func_breakable_colormod(); diff --git a/data/qcsrc/server/g_subs.qc b/data/qcsrc/server/g_subs.qc index 496f532e..5ad223c0 100644 --- a/data/qcsrc/server/g_subs.qc +++ b/data/qcsrc/server/g_subs.qc @@ -674,3 +674,4 @@ float InitMovingBrushTrigger() } return 1; }; +#endif diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 345d605d..aa67f03d 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -80,7 +80,7 @@ float world_initialized; string GetMapname(); string GetGametype(); void GotoNextMap(); -void ShuffleMaplist() +void ShuffleMaplist(); float() DoNextMapOverride; void SetDefaultAlpha() diff --git a/data/qcsrc/server/keyhunt.qc b/data/qcsrc/server/keyhunt.qc index 7ffc580a..9e35d16a 100644 --- a/data/qcsrc/server/keyhunt.qc +++ b/data/qcsrc/server/keyhunt.qc @@ -33,7 +33,14 @@ float kh_no_radar_circles; .float siren_time; // time delay the siren //.float stuff_time; // time delay to stuffcmd a cvar -float test[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +// sigh GMQCC needs to implement this yet. +float test[17] +#ifndef GMQCC += {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; +#else +; +#endif + //test[0] = status of dropped keys, test[1 - 16] = player # //replace 17 with cvar("maxplayers") or similar !!!!!!!!! //for(i = 0; i < maxplayers; ++i) diff --git a/data/qcsrc/server/keyhunt.qh b/data/qcsrc/server/keyhunt.qh index a410045c..4b63d011 100644 --- a/data/qcsrc/server/keyhunt.qh +++ b/data/qcsrc/server/keyhunt.qh @@ -30,5 +30,5 @@ void kh_update_state(); #define STR_ITEM_KH_KEY "item_kh_key" typedef void(void) kh_Think_t; var kh_Think_t kh_Controller_Thinkfunc; -void kh_Controller_SetThink(float t, string msg, kh_Think_t func) -void kh_Key_Remove(entity key) +void kh_Controller_SetThink(float t, string msg, kh_Think_t func); +void kh_Key_Remove(entity key); diff --git a/data/qcsrc/server/miscfunctions.qc b/data/qcsrc/server/miscfunctions.qc index f16f60aa..d30b368c 100644 --- a/data/qcsrc/server/miscfunctions.qc +++ b/data/qcsrc/server/miscfunctions.qc @@ -181,22 +181,27 @@ void GameLogClose() } } -vector PL_VIEW_OFS; -vector PL_MIN; -vector PL_MAX; -vector PL_CROUCH_VIEW_OFS; -vector PL_CROUCH_MIN; -vector PL_CROUCH_MAX; +// you need an init method to set them somewhere +// default values simply become constant +const vector PL_VIEW_OFS; +const vector PL_MIN; +const vector PL_MAX; +const vector PL_CROUCH_VIEW_OFS; +const vector PL_CROUCH_MIN; +const vector PL_CROUCH_MAX; float spawnpoint_nag; void relocate_spawnpoint() { + // this code wouldn't work anyways, they're constants by having default assignment in a header. +#if 0 PL_VIEW_OFS = stov(cvar_string("sv_player_viewoffset")); PL_MIN = stov(cvar_string("sv_player_mins")); PL_MAX = stov(cvar_string("sv_player_maxs")); PL_CROUCH_VIEW_OFS = stov(cvar_string("sv_player_crouch_viewoffset")); PL_CROUCH_MIN = stov(cvar_string("sv_player_crouch_mins")); PL_CROUCH_MAX = stov(cvar_string("sv_player_crouch_maxs")); +#endif // nudge off the floor setorigin(self, self.origin + '0 0 1'); diff --git a/data/qcsrc/server/mode_onslaught.qc b/data/qcsrc/server/mode_onslaught.qc index 0826d1ef..b52bec96 100644 --- a/data/qcsrc/server/mode_onslaught.qc +++ b/data/qcsrc/server/mode_onslaught.qc @@ -595,7 +595,11 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage, self.islinked = FALSE; self.isshielded = FALSE; self.takedamage = DAMAGE_NO; // can't be hurt anymore +#ifndef GMQCC self.event_damage = SUB_Null; // won't do anything if hurt +#else + self.event_damage = nil; +#endif self.count = 0; // reset counter self.think = onslaught_generator_deaththink; // explosion sequence self.nextthink = time; // start exploding immediately diff --git a/data/qcsrc/server/pathlib/movenode.qc b/data/qcsrc/server/pathlib/movenode.qc index 1aa1c665..d6b8c753 100644 --- a/data/qcsrc/server/pathlib/movenode.qc +++ b/data/qcsrc/server/pathlib/movenode.qc @@ -32,7 +32,7 @@ vector pathlib_wateroutnode(vector start,vector end) return end; } -vector pathlib_swimnode(vector start,vector end) +vector pathlib_swimnode(vector start,vector end, float /*unused*/) { pathlib_movenode_goodnode = 0; diff --git a/data/qcsrc/server/pathlib/pathlib.qh b/data/qcsrc/server/pathlib/pathlib.qh index 77de8894..bdb513d0 100644 --- a/data/qcsrc/server/pathlib/pathlib.qh +++ b/data/qcsrc/server/pathlib/pathlib.qh @@ -60,7 +60,7 @@ vector movenode_boxmin; float pathlib_movenode_goodnode; vector pathlib_wateroutnode(vector start, vector end); -vector pathlib_swimnode(vector start, vector end); +vector pathlib_swimnode(vector start, vector end, float /*unused*/); vector pathlib_flynode(vector start, vector end); vector pathlib_walknode(vector start, vector end, float doedge); var vector pathlib_movenode(vector start, vector end, float doedge); diff --git a/data/qcsrc/server/sys.qh b/data/qcsrc/server/sys.qh index eaefeb2a..0d9cda6b 100644 --- a/data/qcsrc/server/sys.qh +++ b/data/qcsrc/server/sys.qh @@ -1,4 +1,3 @@ -#pragma flag off fastarrays // make dp behave with new fteqcc versions. remove when dp bug with fteqcc fastarrays is fixed #define SVQC // DO NOT modify the contents of this file, or you will risk incompatibility with the game engine. diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 4ecb6527..4bfa0771 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -5,6 +5,8 @@ #define ITEM_RESPAWNTIME_INITIAL(i) (ITEM_RESPAWN_TICKS + random() * ((i).respawntime + (i).respawntimejitter - ITEM_RESPAWN_TICKS)) // range: 10 .. respawntime + respawntimejitter +#define Item_Func_Null null + floatfield Item_CounterField(float it) { switch(it) @@ -69,7 +71,7 @@ void Item_Show (entity e, float mode) e.colormod = '0 0 0'; e.glowmod = e.colormod; e.alpha = 0; - e.customizeentityforclient = func_null; + e.customizeentityforclient = Item_Func_Null; e.spawnshieldtime = 1; } @@ -81,7 +83,7 @@ void Item_Show (entity e, float mode) e.colormod = '0 0 0'; e.glowmod = e.colormod; e.alpha = 0; - e.customizeentityforclient = func_null; + e.customizeentityforclient = Item_Func_Null; e.spawnshieldtime = 1; } @@ -105,7 +107,7 @@ void Item_Show (entity e, float mode) e.colormod = stov(cvar_string("g_ghost_items_color")); e.glowmod = e.colormod; e.alpha = g_ghost_items; - e.customizeentityforclient = func_null; + e.customizeentityforclient = Item_Func_Null; e.spawnshieldtime = 1; } @@ -117,7 +119,7 @@ void Item_Show (entity e, float mode) e.colormod = stov(cvar_string("g_ghost_items_color")); e.glowmod = e.colormod; e.alpha = 0; - e.customizeentityforclient = func_null; + e.customizeentityforclient = Item_Func_Null; e.spawnshieldtime = 1; } diff --git a/data/qcsrc/server/t_plats.qc b/data/qcsrc/server/t_plats.qc index e7ac9151..641bb564 100644 --- a/data/qcsrc/server/t_plats.qc +++ b/data/qcsrc/server/t_plats.qc @@ -1404,8 +1404,14 @@ float SECRET_1ST_DOWN = 4; // 1st move is down from arrow float SECRET_NO_SHOOT = 8; // only opened by trigger float SECRET_YES_SHOOT = 16; // shootable even if targeted - +// This is a bug in the code .. this is the HACK to work around the bug since casts don't exist yet. +#ifdef GMQCC +void fd_secret_use_core(entity, entity, float, float, vector, vector) +#else +void fd_secret_use(); +void fd_secret_use_core() { fd_secret_use(); } void fd_secret_use() +#endif { local float temp; string message_save; @@ -1455,6 +1461,12 @@ void fd_secret_use() sound(self, CHAN_TRIGGER, self.noise2, VOL_BASE, ATTN_NORM); }; +#ifdef GMQCC +void fd_secret_use() { + fd_secret_use_core(nil, nil, nil, nil, nil, nil); +} +#endif + // Wait after first movement... void fd_secret_move1() { @@ -1610,7 +1622,7 @@ void spawnfunc_func_door_secret() { self.health = 10000; self.takedamage = DAMAGE_YES; - self.event_damage = fd_secret_use; + self.event_damage = fd_secret_use_core; } self.oldorigin = self.origin; if (!self.wait) diff --git a/data/qcsrc/server/t_quake.qc b/data/qcsrc/server/t_quake.qc index b917287c..a78f4b90 100644 --- a/data/qcsrc/server/t_quake.qc +++ b/data/qcsrc/server/t_quake.qc @@ -42,20 +42,20 @@ void junk_function () self.light_lev = 0; self.color = '0 0 0'; self.style = 0; - self.jumppadsused = world; + self.jumppadsused[0] = world; self.disableclientprediction = 0; - self.contentstransition = SUB_Null; + self.contentstransition = null; self.dphitcontentsmask = 0; self.modelflags = 0; - self.attack_finished_for = 0; // why is this even valid? Spiiiiiiiiiiiiiiiiiiiiike! + self.attack_finished_for[0] = 0; // why is this even valid? Spiiiiiiiiiiiiiiiiiiiiike! self.notsingle = 0; trace_dphittexturename = ""; require_spawnfunc_prefix = 1; - self.movetypesteplandevent = SUB_Null; + self.movetypesteplandevent = null; self.viewzoom = 0; - self.cvar_cl_weaponpriorities = ""; - self.scores = 0; - self.teamscores = 0; + self.cvar_cl_weaponpriorities[0] = ""; + self.scores[0] = 0; + self.teamscores[0] = 0; gettaginfo_parent = 0; gettaginfo_name = ""; gettaginfo_offset = '0 0 0'; diff --git a/data/qcsrc/server/tturrets/include/turrets_early.qh b/data/qcsrc/server/tturrets/include/turrets_early.qh index c8df28df..c02f4a7e 100644 --- a/data/qcsrc/server/tturrets/include/turrets_early.qh +++ b/data/qcsrc/server/tturrets/include/turrets_early.qh @@ -489,9 +489,9 @@ float turret_stdproc_targetscore_support(entity e_turret,entity e_target); * Aim functions */ /// Generic aimer guided by self.aim_flags -vector turret_stdproc_aim_generic() +vector turret_stdproc_aim_generic(); // Straight line, current location -//vector turret_stdproc_aim_simple() +//vector turret_stdproc_aim_simple(); /* * Turret turning & pitch diff --git a/data/qcsrc/server/tturrets/system/system_damage.qc b/data/qcsrc/server/tturrets/system/system_damage.qc index cb7c2656..80cfd6a4 100644 --- a/data/qcsrc/server/tturrets/system/system_damage.qc +++ b/data/qcsrc/server/tturrets/system/system_damage.qc @@ -147,7 +147,11 @@ void turret_stdproc_die() self.customizeentityforclient = SUB_False; self.tur_head.customizeentityforclient = SUB_False; +#ifndef GMQCC self.event_damage = SUB_Null; +#else + self.event_damage = nil; +#endif self.takedamage = DAMAGE_NO; self.effects = 0; @@ -324,8 +328,13 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo if (self.health <= 0) { +#ifndef GMQCC self.event_damage = SUB_Null; self.tur_head.event_damage = SUB_Null; +#else + self.event_damage = nil; + self.tur_head.event_damage = nil; +#endif self.takedamage = DAMAGE_NO; self.nextthink = time; self.think = turret_stdproc_die; diff --git a/data/qcsrc/server/w_common.qc b/data/qcsrc/server/w_common.qc index 8f4226c1..a4edfdd6 100644 --- a/data/qcsrc/server/w_common.qc +++ b/data/qcsrc/server/w_common.qc @@ -471,7 +471,7 @@ void fireBullet (vector start, vector dir, float spread, float damage, float for void W_PrepareExplosionByDamage(entity attacker, void() explode) { self.takedamage = DAMAGE_NO; - self.event_damage = SUB_Null; + self.event_damage = null; self.owner = attacker; // do not explode NOW but in the NEXT FRAME! diff --git a/docs/TODO.txt b/docs/TODO.txt index 3affb267..cdae9fd8 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -247,3 +247,7 @@ - 0.8 BUG: Someone's reporting swallow speed doesn't change with the cvar - 0.8: Make some of the foxes (bots) in the campaign male + +- 0.8 BUG: In player.sounds files, "tag female" is used for the male voices too + +- 0.8: Fix all the gmqcc warnings when using the default Xonotic parameters