]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Declare more ints as ints
authorTimePath <andrew.hardaker1995@gmail.com>
Thu, 29 Jan 2015 23:09:25 +0000 (10:09 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Thu, 29 Jan 2015 23:09:25 +0000 (10:09 +1100)
52 files changed:
qcsrc/client/hud.qh
qcsrc/client/main.qh
qcsrc/common/campaign_file.qc
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh
qcsrc/common/playerstats.qc
qcsrc/common/test.qc
qcsrc/dpdefs/dpextensions.qh
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/xonotic/dialog_settings_effects.qc
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/antilag.qc
qcsrc/server/bot/bot.qc
qcsrc/server/bot/bot.qh
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/bot/havocbot/role_onslaught.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/bot/scripting.qc
qcsrc/server/bot/waypoints.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_player.qh
qcsrc/server/command/common.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/command/getreplies.qh
qcsrc/server/command/radarmap.qc
qcsrc/server/command/radarmap.qh
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/constants.qh
qcsrc/server/defs.qh
qcsrc/server/ent_cs.qc
qcsrc/server/ent_cs.qh
qcsrc/server/func_breakable.qc
qcsrc/server/g_casings.qc
qcsrc/server/miscfunctions.qh
qcsrc/server/mutators/gamemode_assault.qh
qcsrc/server/sys-post.qh
qcsrc/server/sys-pre.qh
qcsrc/server/t_jumppads.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/csqcprojectile.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/tracing.qh
qcsrc/server/weapons/weaponsystem.qc

index 167fd2141a2ff599bd1381a0f07cfedf62db4dbe..16a7645fd991819a55fd1b8de4349d318ee15f30 100644 (file)
@@ -36,8 +36,8 @@ float complain_weapon_time;
 int ps_primary, ps_secondary;
 int ts_primary, ts_secondary;
 
 int ps_primary, ps_secondary;
 int ts_primary, ts_secondary;
 
-float last_switchweapon;
-float last_activeweapon;
+int last_switchweapon;
+int last_activeweapon;
 float weapontime;
 float weaponprevtime;
 
 float weapontime;
 float weaponprevtime;
 
@@ -363,4 +363,4 @@ void HUD_Notify_Push(string icon, string attacker, string victim);
 
 var void HUD_ModIcons_GameType(vector pos, vector size);
 void HUD_ModIcons_SetFunc();
 
 var void HUD_ModIcons_GameType(vector pos, vector size);
 void HUD_ModIcons_SetFunc();
-#endif
\ No newline at end of file
+#endif
index 3b36a12c0ea3bd31701fa330d13ec669e62beed7..b8823e6296d4de67aed98f1f2da417aa00ff0381 100644 (file)
@@ -99,9 +99,9 @@ float button_zoom;
 float spectatorbutton_zoom;
 float button_attack2;
 
 float spectatorbutton_zoom;
 float button_attack2;
 
-float activeweapon;
-float switchingweapon;
-float switchweapon;
+int activeweapon;
+int switchingweapon;
+int switchweapon;
 float current_viewzoom;
 float zoomin_effect;
 float warmup_stage;
 float current_viewzoom;
 float zoomin_effect;
 float warmup_stage;
@@ -149,4 +149,4 @@ entity entcs_receiver[255]; // 255 is the engine limit on maxclients
 float hud;
 float view_quality;
 int framecount;
 float hud;
 float view_quality;
 int framecount;
-#endif
\ No newline at end of file
+#endif
index 27319ec7cca98d2adc1692f767e683ea3cadc14f..69dbb0b1d3af124d6900d59381e6f67919f31036 100644 (file)
@@ -11,7 +11,7 @@
 // - Loads campaign level data (up to n entries starting at offset)
 //   into the globals
 // - Returns the number of entries successfully read
 // - Loads campaign level data (up to n entries starting at offset)
 //   into the globals
 // - Returns the number of entries successfully read
-float CampaignFile_Load(float offset, float n)
+float CampaignFile_Load(int offset, float n)
 {
        float fh;
        float lineno;
 {
        float fh;
        float lineno;
index 41c14683104495d12e53e1e9743b0ffd04da378e..43e81cbf9cc57698d9a893d1d6f2f1916485829b 100644 (file)
@@ -1415,7 +1415,7 @@ void MapInfo_Shutdown()
        }
 }
 
        }
 }
 
-float MapInfo_ForbiddenFlags()
+int MapInfo_ForbiddenFlags()
 {
        int f = MAPINFO_FLAG_FORBIDDEN;
 
 {
        int f = MAPINFO_FLAG_FORBIDDEN;
 
@@ -1430,7 +1430,7 @@ float MapInfo_ForbiddenFlags()
        return f;
 }
 
        return f;
 }
 
-float MapInfo_RequiredFlags()
+int MapInfo_RequiredFlags()
 {
        int f = 0;
 
 {
        int f = 0;
 
index 03ad44870509c12fe652127d059da3a127c86092..6083350fa92028cf2be820c251875847a0927e9e 100644 (file)
@@ -120,8 +120,8 @@ float MapInfo_progress;
 float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
 int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
 int MapInfo_CurrentGametype(); // retrieves current gametype from cvars
 float MapInfo_FilterGametype(float gametype, float features, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate); // 1 on success, 0 on temporary failure (call it again next frame then; use MapInfo_progress as progress indicator)
 int MapInfo_CurrentFeatures(); // retrieves currently required features from cvars
 int MapInfo_CurrentGametype(); // retrieves current gametype from cvars
-float MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
-float MapInfo_RequiredFlags(); // retrieves current flags from cvars
+int MapInfo_ForbiddenFlags(); // retrieves current flags from cvars
+int MapInfo_RequiredFlags(); // retrieves current flags from cvars
 
 // load info about the i-th map into the MapInfo_Map_* globals
 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
 
 // load info about the i-th map into the MapInfo_Map_* globals
 float MapInfo_Get_ByID(float i); // 1 on success, 0 on failure
@@ -168,4 +168,4 @@ void MapInfo_Shutdown(); // call this in the shutdown handler
 
 #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
 #define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* +*"
 
 #define MAPINFO_SETTEMP_ACL_USER cvar_string("g_mapinfo_settemp_acl")
 #define MAPINFO_SETTEMP_ACL_SYSTEM "-g_mapinfo_* -rcon_* -_* -g_ban* +*"
-#endif
\ No newline at end of file
+#endif
index 4a4f63686290f64740ed26d332757d3d93ab6a42..27a7bb6ec2cd2f7d8238e0f27e424adb4cd792a5 100644 (file)
@@ -30,7 +30,7 @@ void PlayerStats_GameReport_AddPlayer(entity e)
                { s = e.crypto_idfp; }
        else if(IS_BOT_CLIENT(e))
                { s = sprintf("bot#%g#%s", skill, e.cleanname); }
                { s = e.crypto_idfp; }
        else if(IS_BOT_CLIENT(e))
                { s = sprintf("bot#%g#%s", skill, e.cleanname); }
-               
+
        if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
        {
                if(IS_BOT_CLIENT(e))
        if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
        {
                if(IS_BOT_CLIENT(e))
@@ -38,13 +38,13 @@ void PlayerStats_GameReport_AddPlayer(entity e)
                else
                        { s = sprintf("player#%d", e.playerid); }
        }
                else
                        { s = sprintf("player#%d", e.playerid); }
        }
-       
+
        e.playerstats_id = strzone(s);
 
        // now add the player to the database
        string key = sprintf("%s:*", e.playerstats_id);
        string p = db_get(PS_GR_OUT_DB, key);
        e.playerstats_id = strzone(s);
 
        // now add the player to the database
        string key = sprintf("%s:*", e.playerstats_id);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_PL)
        if(p == "")
        {
                if(PS_GR_OUT_PL)
@@ -63,7 +63,7 @@ void PlayerStats_GameReport_AddTeam(float t)
 
        string key = sprintf("%d", t);
        string p = db_get(PS_GR_OUT_DB, key);
 
        string key = sprintf("%d", t);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_TL)
        if(p == "")
        {
                if(PS_GR_OUT_TL)
@@ -82,7 +82,7 @@ void PlayerStats_GameReport_AddEvent(string event_id)
 
        string key = sprintf("*:%s", event_id);
        string p = db_get(PS_GR_OUT_DB, key);
 
        string key = sprintf("*:%s", event_id);
        string p = db_get(PS_GR_OUT_DB, key);
-       
+
        if(p == "")
        {
                if(PS_GR_OUT_EVL)
        if(p == "")
        {
                if(PS_GR_OUT_EVL)
@@ -168,7 +168,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
 void PlayerStats_GameReport(float finished)
 {
        if(PS_GR_OUT_DB < 0) { return; }
 void PlayerStats_GameReport(float finished)
 {
        if(PS_GR_OUT_DB < 0) { return; }
-       
+
        PlayerScore_Sort(score_dummyfield, 0, 0, 0);
        PlayerScore_Sort(scoreboard_pos, 1, 1, 1);
        if(teamplay) { PlayerScore_TeamStats(); }
        PlayerScore_Sort(score_dummyfield, 0, 0, 0);
        PlayerScore_Sort(scoreboard_pos, 1, 1, 1);
        if(teamplay) { PlayerScore_TeamStats(); }
@@ -362,7 +362,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_playerid", p));
                                if(nn != "") { url_fputs(fh, sprintf("i %s\n", nn)); }
 
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_playerid", p));
                                if(nn != "") { url_fputs(fh, sprintf("i %s\n", nn)); }
 
-                               // player name 
+                               // player name
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_netname", p));
                                if(nn != "") { url_fputs(fh, sprintf("n %s\n", nn)); }
 
                                nn = db_get(PS_GR_OUT_DB, sprintf("%s:_netname", p));
                                if(nn != "") { url_fputs(fh, sprintf("n %s\n", nn)); }
 
@@ -401,7 +401,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                        url_fclose(fh);
                        break;
                }
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
@@ -414,7 +414,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                        }
                        break;
                }
                        }
                        break;
                }
-               
+
                case URL_READY_ERROR:
                default:
                {
                case URL_READY_ERROR:
                default:
                {
@@ -523,7 +523,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                        url_fclose(fh);
                        break;
                }
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CANREAD:
                {
                        string s = "";
                case URL_READY_CANREAD:
                {
                        string s = "";
@@ -592,7 +592,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                        print("Player stats synchronized with server\n");
                        break;
                }
                        print("Player stats synchronized with server\n");
                        break;
                }
-               
+
                case URL_READY_ERROR:
                default:
                {
                case URL_READY_ERROR:
                default:
                {
@@ -629,7 +629,7 @@ void PlayerStats_PlayerDetail_AddItem(string event, string data)
                        db_put(PS_D_IN_DB, marker, PS_D_IN_EVL);
                        strunzone(PS_D_IN_EVL);
                }
                        db_put(PS_D_IN_DB, marker, PS_D_IN_EVL);
                        strunzone(PS_D_IN_EVL);
                }
-               else { db_put(PS_D_IN_DB, marker, "#"); } 
+               else { db_put(PS_D_IN_DB, marker, "#"); }
                PS_D_IN_EVL = strzone(marker);
        }
 
                PS_D_IN_EVL = strzone(marker);
        }
 
@@ -717,7 +717,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                        url_fclose(fh);
                        break;
                }
                        url_fclose(fh);
                        break;
                }
-               
+
                case URL_READY_CANREAD:
                {
                        //print("PlayerStats_PlayerDetail_Handler(): Got response from player stats server:\n");
                case URL_READY_CANREAD:
                {
                        //print("PlayerStats_PlayerDetail_Handler(): Got response from player stats server:\n");
@@ -729,7 +729,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                string key = "", event = "", data = "";
 
                                if(argv(0) == "#") { continue; }
                                string key = "", event = "", data = "";
 
                                if(argv(0) == "#") { continue; }
-                               
+
                                if(count == 2)
                                {
                                        key = argv(0);
                                if(count == 2)
                                {
                                        key = argv(0);
@@ -773,7 +773,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status)
                                                }
                                                break;
                                        }
                                                }
                                                break;
                                        }
-                                       
+
                                        default:
                                        {
                                                printf(
                                        default:
                                        {
                                                printf(
index a9360913e0567e8ec78bcbdc1c419a6038728a7f..966553b27228efa1aa1f277fb73a61e335deda1e 100644 (file)
@@ -24,10 +24,9 @@ void TEST_OK()
 
 float TEST_RunAll()
 {
 
 float TEST_RunAll()
 {
-       float f = 0;
+       int f = 0;
        float n = numentityfields();
        float n = numentityfields();
-       float i;
-       for(i = 0; i < n; ++i)
+       for(int i = 0; i < n; ++i)
        {
                string name = entityfieldname(i);
                if(substring(name, 0, 6) == "_TEST_")
        {
                string name = entityfieldname(i);
                if(substring(name, 0, 6) == "_TEST_")
index c27d9903f3d0881f6afa707054aad401881da140..26d351a209b80518c6295cc41b2d3d33ddee60ad 100644 (file)
@@ -275,7 +275,7 @@ float EF_DELTA = 8388608;
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //effects bit:
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //effects bit:
-float EF_LOWPRECISION = 4194304;
+const int EF_LOWPRECISION = 4194304;
 //description:
 //uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
 
 //description:
 //uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
 
@@ -2352,7 +2352,7 @@ string(float n) argv = #442;
 //idea: FrikaC
 //darkplaces implementation: LordHavoc
 //effects bit:
 //idea: FrikaC
 //darkplaces implementation: LordHavoc
 //effects bit:
-float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
+const int EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
 //field definitions:
 .float cursor_active; // true if cl_prydoncursor mode is on
 .vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
 //field definitions:
 .float cursor_active; // true if cl_prydoncursor mode is on
 .vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
@@ -2555,4 +2555,4 @@ void(float pause) setpause = #531;
 float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
 //description:
 //use -1 as buffer handle to justs end delim as postdata
 float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
 //description:
 //use -1 as buffer handle to justs end delim as postdata
-#endif
\ No newline at end of file
+#endif
index 94d167e5ed560d3de78073a9c11db770bf81ad2c..e9f3538ff5d2ec968f6c270a4441b5da31d9d1eb 100644 (file)
@@ -12,7 +12,7 @@
 
 float mouseButtonsPressed;
 vector menuMousePos;
 
 float mouseButtonsPressed;
 vector menuMousePos;
-float menuShiftState;
+int menuShiftState;
 float menuPrevTime;
 float menuAlpha;
 float menuLogoAlpha;
 float menuPrevTime;
 float menuAlpha;
 float menuLogoAlpha;
index 4ff32361e9c7bf0a2dee8c941f5c2ee5542bb652..2aa2b5d6c95074d5a147f3266e29ff18369b2eae 100644 (file)
 
 // constants
 
 
 // constants
 
-const float GAME_ISSERVER      = 1;
-const float GAME_CONNECTED     = 2;
-const float GAME_DEVELOPER     = 4;
+const int GAME_ISSERVER        = 1;
+const int GAME_CONNECTED       = 2;
+const int GAME_DEVELOPER       = 4;
 
 // prototypes
 
 float Menu_Active;
 
 // prototypes
 
 float Menu_Active;
-float gamestatus;
+int gamestatus;
 
 
-const float S_SHIFT = 1;
-const float S_CTRL = 2;
-const float S_ALT = 4;
+const int S_SHIFT = 1;
+const int S_CTRL = 2;
+const int S_ALT = 4;
 
 float frametime;
 float time;
 
 float frametime;
 float time;
@@ -52,4 +52,4 @@ void preMenuDraw(); // this is run before the menu is drawn. You may put some st
 void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
 
 void m_sync();
 void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
 
 void m_sync();
-#endif
\ No newline at end of file
+#endif
index 7ec7ba027f2cb6857acac402b0c25c383e25ef35..811cb0998f2774588359af13bee781431b1619f7 100644 (file)
@@ -7,7 +7,6 @@ CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
        ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
 ENDCLASS(XonoticEffectsSettingsTab)
 entity makeXonoticEffectsSettingsTab();
        ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space
 ENDCLASS(XonoticEffectsSettingsTab)
 entity makeXonoticEffectsSettingsTab();
-float updateCompression();
 #endif
 
 #ifdef IMPLEMENTATION
 #endif
 
 #ifdef IMPLEMENTATION
index 0eb5b215caf64888b8b680c0147942472c5a0fb7..0846526d0c66283fd46e94f0624414c0cec6d103 100644 (file)
@@ -329,8 +329,8 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                n = tokenizebyseparator(data, "\n");
 
        float i;
                n = tokenizebyseparator(data, "\n");
 
        float i;
-       string s; 
-       
+       string s;
+
        string un_version = "";
        string un_download = "";
        string un_url = "";
        string un_version = "";
        string un_download = "";
        string un_url = "";
@@ -339,12 +339,12 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
        string un_promoted = "";
        string un_recommended = "";
        string un_compatexpire = "";
        string un_promoted = "";
        string un_recommended = "";
        string un_compatexpire = "";
-       
+
        for(i = 0; i < n; ++i)
        {
                s = substring(argv(i), 2, -1);
                if(s == "") { continue; } // ignore empty lines
        for(i = 0; i < n; ++i)
        {
                s = substring(argv(i), 2, -1);
                if(s == "") { continue; } // ignore empty lines
-               
+
                switch(substring(argv(i), 0, 1))
                {
                        case "V":
                switch(substring(argv(i), 0, 1))
                {
                        case "V":
@@ -411,7 +411,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                        }
                }
        }
                        }
                }
        }
-       
+
        if(un_emergency_pk3s != "")
        {
                _Nex_ExtResponseSystem_Packs = strzone(un_emergency_pk3s);
        if(un_emergency_pk3s != "")
        {
                _Nex_ExtResponseSystem_Packs = strzone(un_emergency_pk3s);
index 3f24d1d84ad5036591ed22d22892be517c190326..64072977f60b7baa7b7de06b7b39f848e62756a1 100644 (file)
@@ -19,13 +19,15 @@ void setDependentAND3(entity e, string theCvarName, float theCvarMin, float theC
 void setDependentStringNotEqual(entity e, string theCvarName, string theCvarValue);
 void setDependentWeird(entity e, float(entity) func);
 
 void setDependentStringNotEqual(entity e, string theCvarName, string theCvarValue);
 void setDependentWeird(entity e, float(entity) func);
 
-float tooltipdb;
+int tooltipdb;
 void loadTooltips();
 void unloadTooltips();
 string getZonedTooltipForIdentifier(string s);
 
 string resolvemod(string m);
 
 void loadTooltips();
 void unloadTooltips();
 string getZonedTooltipForIdentifier(string s);
 
 string resolvemod(string m);
 
+float updateCompression();
+
 void UpdateNotification_URI_Get_Callback(float id, float status, string data);
 
 void URI_Get_Callback(float id, float status, string data);
 void UpdateNotification_URI_Get_Callback(float id, float status, string data);
 
 void URI_Get_Callback(float id, float status, string data);
@@ -54,4 +56,4 @@ string _Nex_ExtResponseSystem_RecommendedServers;
 float _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh;
 
 void CheckSendCvars(entity me, string cvarnamestring);
 float _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh;
 
 void CheckSendCvars(entity me, string cvarnamestring);
-#endif
\ No newline at end of file
+#endif
index ee91fb7928b3d139bc6219a5323b2823de1960bb..6f8f0f487e0c7e811cd425d7ceb9da8dcc93ec63 100644 (file)
@@ -7,10 +7,10 @@
     #include "antilag.qh"
 #endif
 
     #include "antilag.qh"
 #endif
 
-const float ANTILAG_MAX_ORIGINS = 64;
+const int ANTILAG_MAX_ORIGINS = 64;
 .vector antilag_origins[ANTILAG_MAX_ORIGINS];
 .float antilag_times[ANTILAG_MAX_ORIGINS];
 .vector antilag_origins[ANTILAG_MAX_ORIGINS];
 .float antilag_times[ANTILAG_MAX_ORIGINS];
-.float antilag_index;
+.int antilag_index;
 .vector antilag_saved_origin;
 .float antilag_takenback;
 
 .vector antilag_saved_origin;
 .float antilag_takenback;
 
@@ -40,9 +40,7 @@ void antilag_record(entity e, float t)
 // finds the index BEFORE t
 float antilag_find(entity e, float t)
 {
 // finds the index BEFORE t
 float antilag_find(entity e, float t)
 {
-       float i;
-
-       for(i = e.antilag_index; i > 0; --i)
+       for(int i = e.antilag_index; i > 0; --i)
                if(e.(antilag_times[i]) >= t)
                        if(e.(antilag_times[i - 1]) < t)
                                return i - 1;
                if(e.(antilag_times[i]) >= t)
                        if(e.(antilag_times[i - 1]) < t)
                                return i - 1;
@@ -51,7 +49,7 @@ float antilag_find(entity e, float t)
                if(e.(antilag_times[ANTILAG_MAX_ORIGINS - 1]) < t)
                        return ANTILAG_MAX_ORIGINS - 1;
 
                if(e.(antilag_times[ANTILAG_MAX_ORIGINS - 1]) < t)
                        return ANTILAG_MAX_ORIGINS - 1;
 
-       for(i = ANTILAG_MAX_ORIGINS - 1; i > e.antilag_index + 1; --i)
+       for(int i = ANTILAG_MAX_ORIGINS - 1; i > e.antilag_index + 1; --i)
                if(e.(antilag_times[i]) >= t)
                        if(e.(antilag_times[i - 1]) < t)
                                return i - 1;
                if(e.(antilag_times[i]) >= t)
                        if(e.(antilag_times[i - 1]) < t)
                                return i - 1;
index f60741463a6f59d7523a83023e78b1e5fdbe4b90..0acd32993595139f9a777ba74b527a1c574ee7a2 100644 (file)
@@ -264,7 +264,7 @@ void bot_setnameandstuff()
 
 void bot_custom_weapon_priority_setup()
 {
 
 void bot_custom_weapon_priority_setup()
 {
-       float tokens, i, c, w;
+       float tokens, i, w;
 
        bot_custom_weapon = false;
 
 
        bot_custom_weapon = false;
 
@@ -297,7 +297,7 @@ void bot_custom_weapon_priority_setup()
        // Parse far distance weapon priorities
        tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
 
        // Parse far distance weapon priorities
        tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
 
-       c = 0;
+       int c = 0;
        for(i=0; i < tokens && c < WEP_COUNT; ++i){
                w = stof(argv(i));
                if ( w >= WEP_FIRST && w <= WEP_LAST) {
        for(i=0; i < tokens && c < WEP_COUNT; ++i){
                w = stof(argv(i));
                if ( w >= WEP_FIRST && w <= WEP_LAST) {
index 8eafb93baa3b26e695e539d3a47fd0542e782376..bcae58dc181e0c89b9db7ef02e729d2660516e04 100644 (file)
@@ -4,21 +4,21 @@
  * Globals and Fields
  */
 
  * Globals and Fields
  */
 
-const float AI_STATUS_ROAMING                                          = 1;    // Bot is just crawling the map. No enemies at sight
-const float AI_STATUS_ATTACKING                                        = 2;    // There are enemies at sight
-const float AI_STATUS_RUNNING                                          = 4;    // Bot is bunny hopping
-const float AI_STATUS_DANGER_AHEAD                             = 8;    // There is lava/slime/trigger_hurt ahead
-const float AI_STATUS_OUT_JUMPPAD                                      = 16;   // Trying to get out of a "vertical" jump pad
-const float AI_STATUS_OUT_WATER                                        = 32;   // Trying to get out of water
-const float AI_STATUS_WAYPOINT_PERSONAL_LINKING        = 64;   // Waiting for the personal waypoint to be linked
-const float AI_STATUS_WAYPOINT_PERSONAL_GOING          = 128;  // Going to a personal waypoint
-const float AI_STATUS_WAYPOINT_PERSONAL_REACHED        = 256;  // Personal waypoint reached
-const float AI_STATUS_JETPACK_FLYING                           = 512;
-const float AI_STATUS_JETPACK_LANDING                          = 1024;
-const float AI_STATUS_STUCK                                            = 2048; // Cannot reach any goal
+const int AI_STATUS_ROAMING                                            = 1;    // Bot is just crawling the map. No enemies at sight
+const int AI_STATUS_ATTACKING                                  = 2;    // There are enemies at sight
+const int AI_STATUS_RUNNING                                            = 4;    // Bot is bunny hopping
+const int AI_STATUS_DANGER_AHEAD                               = 8;    // There is lava/slime/trigger_hurt ahead
+const int AI_STATUS_OUT_JUMPPAD                                        = 16;   // Trying to get out of a "vertical" jump pad
+const int AI_STATUS_OUT_WATER                                  = 32;   // Trying to get out of water
+const int AI_STATUS_WAYPOINT_PERSONAL_LINKING  = 64;   // Waiting for the personal waypoint to be linked
+const int AI_STATUS_WAYPOINT_PERSONAL_GOING            = 128;  // Going to a personal waypoint
+const int AI_STATUS_WAYPOINT_PERSONAL_REACHED  = 256;  // Personal waypoint reached
+const int AI_STATUS_JETPACK_FLYING                             = 512;
+const int AI_STATUS_JETPACK_LANDING                            = 1024;
+const int AI_STATUS_STUCK                                              = 2048; // Cannot reach any goal
 
 .float isbot; // true if this client is actually a bot
 
 .float isbot; // true if this client is actually a bot
-.float aistatus;
+.int aistatus;
 
 // Skill system
 float skill;
 
 // Skill system
 float skill;
@@ -118,4 +118,4 @@ void CheckAllowedTeams(entity for_whom); void GetTeamCounts(entity other);
 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
 
 void bot_calculate_stepheightvec(void);
 float JoinBestTeam(entity pl, float only_return_best, float forcebestteam);
 
 void bot_calculate_stepheightvec(void);
-#endif
\ No newline at end of file
+#endif
index 0d92acbd28cab30cc2117cb3245867a8e9e97fb0..0ecafaf1e87c7aa62fda4892d2c38ef300e05683 100644 (file)
@@ -941,7 +941,7 @@ void havocbot_chooseenemy()
        self.havocbot_stickenemy = true;
 }
 
        self.havocbot_stickenemy = true;
 }
 
-float havocbot_chooseweapon_checkreload(float new_weapon)
+float havocbot_chooseweapon_checkreload(int new_weapon)
 {
        // bots under this skill cannot find unloaded weapons to reload idly when not in combat,
        // so skip this for them, or they'll never get to reload their weapons at all.
 {
        // bots under this skill cannot find unloaded weapons to reload idly when not in combat,
        // so skip this for them, or they'll never get to reload their weapons at all.
@@ -968,7 +968,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon)
 
 void havocbot_chooseweapon()
 {
 
 void havocbot_chooseweapon()
 {
-       float i;
+       int i;
 
        // ;)
        if(g_weaponarena_weapons == WEPSET_TUBA)
 
        // ;)
        if(g_weaponarena_weapons == WEPSET_TUBA)
@@ -994,8 +994,8 @@ void havocbot_chooseweapon()
        }
 
        // Do not change weapon during the next second after a combo
        }
 
        // Do not change weapon during the next second after a combo
-       i = time - self.lastcombotime;
-       if(i < 1)
+       float f = time - self.lastcombotime;
+       if(f < 1)
                return;
 
        float w;
                return;
 
        float w;
index 56745fbab84c9df411e30317f235d0562d3d2503..55da31783be7fa342b89976d337343fd8acd1682 100644 (file)
@@ -1,9 +1,9 @@
-const float HAVOCBOT_ONS_ROLE_NONE             = 0;
-const float HAVOCBOT_ONS_ROLE_DEFENSE  = 2;
-const float HAVOCBOT_ONS_ROLE_ASSISTANT = 4;
-const float HAVOCBOT_ONS_ROLE_OFFENSE  = 8;
+const int HAVOCBOT_ONS_ROLE_NONE               = 0;
+const int HAVOCBOT_ONS_ROLE_DEFENSE    = 2;
+const int HAVOCBOT_ONS_ROLE_ASSISTANT  = 4;
+const int HAVOCBOT_ONS_ROLE_OFFENSE    = 8;
 
 
-.float havocbot_role_flags;
+.int havocbot_role_flags;
 .float havocbot_attack_time;
 
 .void() havocbot_role;
 .float havocbot_attack_time;
 
 .void() havocbot_role;
@@ -97,7 +97,7 @@ void havocbot_role_ons_setrole(entity bot, float role)
        dprint("\n");
 }
 
        dprint("\n");
 }
 
-float havocbot_ons_teamcount(entity bot, float role)
+float havocbot_ons_teamcount(entity bot, int role)
 {
        float c = 0;
        entity head;
 {
        float c = 0;
        entity head;
index 870cf295d968e5c5ed3487206c0feb9a30572c63..af219b8ec730272f85f334402ea9c8cc4dc229f4 100644 (file)
@@ -152,8 +152,9 @@ void havocbot_goalrating_controlpoints(float ratingscale, vector org, float srad
 void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius)
 {
        entity head;
 void havocbot_goalrating_enemyplayers(float ratingscale, vector org, float sradius)
 {
        entity head;
-       float t, noteam, distance;
-       noteam = ((self.team == 0) || !teamplay);
+       int t;
+       float distance;
+       noref bool noteam = ((self.team == 0) || !teamplay);
 
        if (autocvar_bot_nofire)
                return;
 
        if (autocvar_bot_nofire)
                return;
index 60bb02b652c13e0bad226d9cc6439680781dc12f..16a015c8df25c7b45436418579631a62aaa06a62 100644 (file)
@@ -91,7 +91,7 @@ float bot_havecommand(entity bot, float idx)
        return 1;
 }
 
        return 1;
 }
 
-const float MAX_BOT_PLACES = 4;
+const int MAX_BOT_PLACES = 4;
 .float bot_places_count;
 .entity bot_places[MAX_BOT_PLACES];
 .string bot_placenames[MAX_BOT_PLACES];
 .float bot_places_count;
 .entity bot_places[MAX_BOT_PLACES];
 .string bot_placenames[MAX_BOT_PLACES];
@@ -100,7 +100,7 @@ entity bot_getplace(string placename)
        entity e;
        if(substring(placename, 0, 1) == "@")
        {
        entity e;
        if(substring(placename, 0, 1) == "@")
        {
-               float i, p;
+               int i, p;
                placename = substring(placename, 1, -1);
                string s, s2;
                for(i = 0; i < self.bot_places_count; ++i)
                placename = substring(placename, 1, -1);
                string s, s2;
                for(i = 0; i < self.bot_places_count; ++i)
@@ -138,35 +138,35 @@ entity bot_getplace(string placename)
 
 
 // NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
 
 
 // NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
-const float BOT_CMD_NULL               = 0;
-const float BOT_CMD_PAUSE              = 1;
-const float BOT_CMD_CONTINUE   = 2;
-const float BOT_CMD_WAIT               = 3;
-const float BOT_CMD_TURN               = 4;
-const float BOT_CMD_MOVETO             = 5;
-const float BOT_CMD_RESETGOAL  = 6;    // Not implemented yet
-const float BOT_CMD_CC                         = 7;
-const float BOT_CMD_IF                         = 8;
-const float BOT_CMD_ELSE               = 9;
-const float BOT_CMD_FI                         = 10;
-const float BOT_CMD_RESETAIM   = 11;
-const float BOT_CMD_AIM                = 12;
-const float BOT_CMD_PRESSKEY   = 13;
-const float BOT_CMD_RELEASEKEY         = 14;
-const float BOT_CMD_SELECTWEAPON       = 15;
-const float BOT_CMD_IMPULSE            = 16;
-const float BOT_CMD_WAIT_UNTIL                 = 17;
-const float BOT_CMD_MOVETOTARGET       = 18;
-const float BOT_CMD_AIMTARGET          = 19;
-const float BOT_CMD_BARRIER            = 20;
-const float BOT_CMD_CONSOLE            = 21;
-const float BOT_CMD_SOUND              = 22;
-const float BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
-const float BOT_CMD_WHILE              = 24;   // TODO: Not implemented yet
-const float BOT_CMD_WEND               = 25;   // TODO: Not implemented yet
-const float BOT_CMD_CHASE              = 26;   // TODO: Not implemented yet
-
-const float BOT_CMD_COUNTER    = 24;   // Update this value if you add/remove a command
+const int BOT_CMD_NULL                         = 0;
+const int BOT_CMD_PAUSE                = 1;
+const int BOT_CMD_CONTINUE             = 2;
+const int BOT_CMD_WAIT                         = 3;
+const int BOT_CMD_TURN                         = 4;
+const int BOT_CMD_MOVETO               = 5;
+const int BOT_CMD_RESETGOAL    = 6;    // Not implemented yet
+const int BOT_CMD_CC                   = 7;
+const int BOT_CMD_IF                   = 8;
+const int BOT_CMD_ELSE                         = 9;
+const int BOT_CMD_FI                   = 10;
+const int BOT_CMD_RESETAIM             = 11;
+const int BOT_CMD_AIM                  = 12;
+const int BOT_CMD_PRESSKEY             = 13;
+const int BOT_CMD_RELEASEKEY   = 14;
+const int BOT_CMD_SELECTWEAPON         = 15;
+const int BOT_CMD_IMPULSE              = 16;
+const int BOT_CMD_WAIT_UNTIL   = 17;
+const int BOT_CMD_MOVETOTARGET         = 18;
+const int BOT_CMD_AIMTARGET    = 19;
+const int BOT_CMD_BARRIER              = 20;
+const int BOT_CMD_CONSOLE              = 21;
+const int BOT_CMD_SOUND                = 22;
+const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
+const int BOT_CMD_WHILE                = 24;   // TODO: Not implemented yet
+const int BOT_CMD_WEND                         = 25;   // TODO: Not implemented yet
+const int BOT_CMD_CHASE                = 26;   // TODO: Not implemented yet
+
+const int BOT_CMD_COUNTER              = 24;   // Update this value if you add/remove a command
 
 // NOTE: Following commands should be implemented on the bot ai
 //              If a new command should be handled by the target ai(s) please declare it here
 
 // NOTE: Following commands should be implemented on the bot ai
 //              If a new command should be handled by the target ai(s) please declare it here
@@ -174,13 +174,13 @@ const float BOT_CMD_COUNTER       = 24;   // Update this value if you add/remove a comm
 .float() cmd_resetgoal;
 
 //
 .float() cmd_resetgoal;
 
 //
-const float BOT_CMD_PARAMETER_NONE = 0;
-const float BOT_CMD_PARAMETER_FLOAT = 1;
-const float BOT_CMD_PARAMETER_STRING = 2;
-const float BOT_CMD_PARAMETER_VECTOR = 3;
+const int BOT_CMD_PARAMETER_NONE = 0;
+const int BOT_CMD_PARAMETER_FLOAT = 1;
+const int BOT_CMD_PARAMETER_STRING = 2;
+const int BOT_CMD_PARAMETER_VECTOR = 3;
 
 float bot_cmds_initialized;
 
 float bot_cmds_initialized;
-float bot_cmd_parm_type[BOT_CMD_COUNTER];
+int bot_cmd_parm_type[BOT_CMD_COUNTER];
 string bot_cmd_string[BOT_CMD_COUNTER];
 
 // Bots command queue
 string bot_cmd_string[BOT_CMD_COUNTER];
 
 // Bots command queue
@@ -189,7 +189,7 @@ entity bot_cmd;     // global current command
 
 .float is_bot_cmd;                     // Tells if the entity is a bot command
 .float bot_cmd_index;                  // Position of the command in the queue
 
 .float is_bot_cmd;                     // Tells if the entity is a bot command
 .float bot_cmd_index;                  // Position of the command in the queue
-.float bot_cmd_type;                   // If of command (see the BOT_CMD_* defines)
+.int bot_cmd_type;                     // If of command (see the BOT_CMD_* defines)
 .float bot_cmd_parm_float;             // Field to store a float parameter
 .string bot_cmd_parm_string;           // Field to store a string parameter
 .vector bot_cmd_parm_vector;           // Field to store a vector parameter
 .float bot_cmd_parm_float;             // Field to store a float parameter
 .string bot_cmd_parm_string;           // Field to store a string parameter
 .vector bot_cmd_parm_vector;           // Field to store a vector parameter
@@ -321,7 +321,7 @@ entity find_bot_by_number(float number)
 
 float bot_decodecommand(string cmdstring)
 {
 
 float bot_decodecommand(string cmdstring)
 {
-       float cmd_parm_type, i;
+       float cmd_parm_type;
        float sp;
        string parm;
 
        float sp;
        string parm;
 
@@ -339,6 +339,7 @@ float bot_decodecommand(string cmdstring)
        if(!bot_cmds_initialized)
                bot_commands_init();
 
        if(!bot_cmds_initialized)
                bot_commands_init();
 
+       int i;
        for(i=1;i<BOT_CMD_COUNTER;++i)
        {
                if(bot_cmd_string[i]!=cmdstring)
        for(i=1;i<BOT_CMD_COUNTER;++i)
        {
                if(bot_cmd_string[i]!=cmdstring)
@@ -380,7 +381,7 @@ float bot_decodecommand(string cmdstring)
 
 void bot_cmdhelp(string scmd)
 {
 
 void bot_cmdhelp(string scmd)
 {
-       float i, ntype;
+       int i, ntype;
        string stype;
 
        if(!bot_cmds_initialized)
        string stype;
 
        if(!bot_cmds_initialized)
@@ -495,7 +496,7 @@ void bot_cmdhelp(string scmd)
 
 void bot_list_commands()
 {
 
 void bot_list_commands()
 {
-       float i;
+       int i;
        string ptype;
 
        if(!bot_cmds_initialized)
        string ptype;
 
        if(!bot_cmds_initialized)
@@ -526,7 +527,7 @@ void bot_list_commands()
 }
 
 // Commands code
 }
 
 // Commands code
-.float bot_exec_status;
+.int bot_exec_status;
 
 #define BOT_EXEC_STATUS_IDLE   0
 #define BOT_EXEC_STATUS_PAUSED 1
 
 #define BOT_EXEC_STATUS_IDLE   0
 #define BOT_EXEC_STATUS_PAUSED 1
@@ -648,13 +649,13 @@ float bot_cmd_select_weapon()
        return CMD_STATUS_FINISHED;
 }
 
        return CMD_STATUS_FINISHED;
 }
 
-.float bot_cmd_condition_status;
+.int bot_cmd_condition_status;
 
 
-const float CMD_CONDITION_NONE = 0;
-const float CMD_CONDITION_true = 1;
-const float CMD_CONDITION_false = 2;
-const float CMD_CONDITION_true_BLOCK = 4;
-const float CMD_CONDITION_false_BLOCK = 8;
+const int CMD_CONDITION_NONE = 0;
+const int CMD_CONDITION_true = 1;
+const int CMD_CONDITION_false = 2;
+const int CMD_CONDITION_true_BLOCK = 4;
+const int CMD_CONDITION_false_BLOCK = 8;
 
 float bot_cmd_eval(string expr)
 {
 
 float bot_cmd_eval(string expr)
 {
@@ -875,20 +876,20 @@ float bot_cmd_aimtarget()
        return CMD_STATUS_EXECUTING;
 }
 
        return CMD_STATUS_EXECUTING;
 }
 
-.float bot_cmd_keys;
-
-const float BOT_CMD_KEY_NONE           = 0;
-const float BOT_CMD_KEY_FORWARD        = 1;
-const float BOT_CMD_KEY_BACKWARD       = 2;
-const float BOT_CMD_KEY_RIGHT          = 4;
-const float BOT_CMD_KEY_LEFT           = 8;
-const float BOT_CMD_KEY_JUMP           = 16;
-const float BOT_CMD_KEY_ATTACK1        = 32;
-const float BOT_CMD_KEY_ATTACK2        = 64;
-const float BOT_CMD_KEY_USE            = 128;
-const float BOT_CMD_KEY_HOOK           = 256;
-const float BOT_CMD_KEY_CROUCH                 = 512;
-const float BOT_CMD_KEY_CHAT           = 1024;
+.int bot_cmd_keys;
+
+const int BOT_CMD_KEY_NONE             = 0;
+const int BOT_CMD_KEY_FORWARD  = 1;
+const int BOT_CMD_KEY_BACKWARD         = 2;
+const int BOT_CMD_KEY_RIGHT    = 4;
+const int BOT_CMD_KEY_LEFT             = 8;
+const int BOT_CMD_KEY_JUMP             = 16;
+const int BOT_CMD_KEY_ATTACK1  = 32;
+const int BOT_CMD_KEY_ATTACK2  = 64;
+const int BOT_CMD_KEY_USE              = 128;
+const int BOT_CMD_KEY_HOOK             = 256;
+const int BOT_CMD_KEY_CROUCH   = 512;
+const int BOT_CMD_KEY_CHAT             = 1024;
 
 float bot_presskeys()
 {
 
 float bot_presskeys()
 {
index 11d11dd48d88798467218a84890ec82aeeb4a5a5..87141c4bc35a48e26efb00468edc748aaf74d620 100644 (file)
@@ -4,14 +4,14 @@
  * Globals and Fields
  */
 
  * Globals and Fields
  */
 
-const float WAYPOINTFLAG_GENERATED = 8388608;
-const float WAYPOINTFLAG_ITEM = 4194304;
-const float WAYPOINTFLAG_TELEPORT = 2097152;
-const float WAYPOINTFLAG_NORELINK = 1048576;
-const float WAYPOINTFLAG_PERSONAL = 524288;
-const float WAYPOINTFLAG_PROTECTED = 262144;  // Useless WP detection never kills these.
-const float WAYPOINTFLAG_USEFUL = 131072;  // Useless WP detection temporary flag.
-const float WAYPOINTFLAG_DEAD_END = 65536;  // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_GENERATED = 8388608;
+const int WAYPOINTFLAG_ITEM = 4194304;
+const int WAYPOINTFLAG_TELEPORT = 2097152;
+const int WAYPOINTFLAG_NORELINK = 1048576;
+const int WAYPOINTFLAG_PERSONAL = 524288;
+const int WAYPOINTFLAG_PROTECTED = 262144;  // Useless WP detection never kills these.
+const int WAYPOINTFLAG_USEFUL = 131072;  // Useless WP detection temporary flag.
+const int WAYPOINTFLAG_DEAD_END = 65536;  // Useless WP detection temporary flag.
 
 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
 
 // fields you can query using prvm_global server to get some statistics about waypoint linking culling
 float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled;
@@ -29,7 +29,8 @@ float botframe_cachedwaypointlinks;
 .float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost;
 .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
 
 .float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost;
 .float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost;
 
-.float wpfire, wpcost, wpconsidered, wpisbox, wpflags, wplinked, wphardwired;
+.float wpfire, wpcost, wpconsidered, wpisbox, wplinked, wphardwired;
+.int wpflags;
 
 .vector wpnearestpoint;
 
 
 .vector wpnearestpoint;
 
@@ -65,4 +66,4 @@ entity waypoint_spawnpersonal(vector position);
 vector waypoint_fixorigin(vector position);
 
 void botframe_autowaypoints();
 vector waypoint_fixorigin(vector position);
 
 void botframe_autowaypoints();
-#endif
\ No newline at end of file
+#endif
index 659fae4b2694046182d55d2997388639acead3f8..b73d74754d9b2a31aa77162e98453d557c9c61b8 100644 (file)
@@ -30,7 +30,7 @@ void send_CSQC_teamnagger() {
        WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
 }
 
        WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
 }
 
-float ClientData_Send(entity to, float sf)
+float ClientData_Send(entity to, int sf)
 {
        if(to != self.owner)
        {
 {
        if(to != self.owner)
        {
@@ -575,7 +575,7 @@ void PutClientInServer (void)
 
                self.bot_attack = true;
                self.monster_attack = true;
 
                self.bot_attack = true;
                self.monster_attack = true;
-               
+
                self.spider_slowness = 0;
 
                self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
                self.spider_slowness = 0;
 
                self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = 0;
@@ -603,8 +603,7 @@ void PutClientInServer (void)
                        WEP_ACTION(j, WR_RESETPLAYER);
 
                        // all weapons must be fully loaded when we spawn
                        WEP_ACTION(j, WR_RESETPLAYER);
 
                        // all weapons must be fully loaded when we spawn
-                       entity e;
-                       e = get_weaponinfo(j);
+                       entity e = get_weaponinfo(j);
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.(weapon_load[j]) = e.reloading_ammo;
                }
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.(weapon_load[j]) = e.reloading_ammo;
                }
@@ -2207,7 +2206,7 @@ Called every frame for each client before the physics are run
 */
 .float usekeypressed;
 void() nexball_setstatus;
 */
 .float usekeypressed;
 void() nexball_setstatus;
-.float items_added;
+.int items_added;
 void PlayerPreThink (void)
 {
        WarpZone_PlayerPhysics_FixVAngle();
 void PlayerPreThink (void)
 {
        WarpZone_PlayerPhysics_FixVAngle();
@@ -2307,7 +2306,7 @@ void PlayerPreThink (void)
        {
                self.revive_progress = bound(0, self.revive_progress - frametime * self.revive_speed, 1);
                self.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * self.revive_progress );
        {
                self.revive_progress = bound(0, self.revive_progress - frametime * self.revive_speed, 1);
                self.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * self.revive_progress );
-               
+
                if(self.health < 1)
                {
                        if(self.vehicle)
                if(self.health < 1)
                {
                        if(self.vehicle)
@@ -2446,7 +2445,7 @@ void PlayerPreThink (void)
                        do_crouch = 0;
 
                // WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
                        do_crouch = 0;
 
                // WEAPONTODO: THIS SHIT NEEDS TO GO EVENTUALLY
-               // It cannot be predicted by the engine! 
+               // It cannot be predicted by the engine!
                if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
                        do_crouch = 0;
 
                if((self.weapon == WEP_SHOCKWAVE || self.weapon == WEP_SHOTGUN) && self.weaponentity.wframe == WFRAME_FIRE2 && time < self.weapon_nextthink)
                        do_crouch = 0;
 
@@ -2495,7 +2494,7 @@ void PlayerPreThink (void)
 
                player_regen();
 
 
                player_regen();
 
-               // WEAPONTODO: Add a weapon request for this 
+               // WEAPONTODO: Add a weapon request for this
                // rot vortex charge to the charge limit
                if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
                        self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
                // rot vortex charge to the charge limit
                if(WEP_CVAR(vortex, charge_rot_rate) && self.vortex_charge > WEP_CVAR(vortex, charge_limit) && self.vortex_charge_rottime < time)
                        self.vortex_charge = bound(WEP_CVAR(vortex, charge_limit), self.vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
index 40c7e318bd3da920f72efb061944471eef40dfe2..2cc8e0215bb8c1b1f0be9620c2b484326f4acde0 100644 (file)
@@ -43,7 +43,7 @@
 
 void ImpulseCommands (void)
 {
 
 void ImpulseCommands (void)
 {
-       float imp;
+       int imp;
        vector org;
        float i;
        float m;
        vector org;
        float i;
        float m;
index c022172ed136a40760f47d37b62ed35e4ab323c2..337342333c0b0230b6d2362d5c1a4119b79d350a 100644 (file)
@@ -31,7 +31,7 @@
 .entity ladder_entity;
 .float gravity;
 .float swamp_slowdown;
 .entity ladder_entity;
 .float gravity;
 .float swamp_slowdown;
-.float lastflags;
+.int lastflags;
 .float lastground;
 .float wasFlying;
 .float spectatorspeed;
 .float lastground;
 .float wasFlying;
 .float spectatorspeed;
@@ -693,7 +693,7 @@ void SV_PlayerPhysics()
        vector wishvel, wishdir, v;
        float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
        string temps;
        vector wishvel, wishdir, v;
        float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
        string temps;
-       float buttons_prev;
+       int buttons_prev;
        float not_allowed_to_move;
        string c;
 
        float not_allowed_to_move;
        string c;
 
index bd5109fb3c4eda3e08d10549693de8b256bd62b3..49d1c1b4691c3136f11c4fd3aa87c27a816c9ea9 100644 (file)
@@ -286,9 +286,10 @@ void calculate_player_respawn_time()
                self.respawn_flags = self.respawn_flags | RESPAWN_FORCE;
 }
 
                self.respawn_flags = self.respawn_flags | RESPAWN_FORCE;
 }
 
-void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
 {
-       float take, save, dh, da, j;
+       float take, save, dh, da;
+       int j;
        vector v;
        float valid_damage_for_weaponstats;
        float excess;
        vector v;
        float valid_damage_for_weaponstats;
        float excess;
@@ -525,8 +526,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                        Obituary (attacker, inflictor, self, deathtype);
 
         // increment frag counter for used weapon type
                        Obituary (attacker, inflictor, self, deathtype);
 
         // increment frag counter for used weapon type
-        float w;
-        w = DEATH_WEAPONOF(deathtype);
+        int w = DEATH_WEAPONOF(deathtype);
         if(WEP_VALID(w))
        if(accuracy_isgooddamage(attacker, self))
         attacker.accuracy.(accuracy_frags[w-1]) += 1;
         if(WEP_VALID(w))
        if(accuracy_isgooddamage(attacker, self))
         attacker.accuracy.(accuracy_frags[w-1]) += 1;
index 4479f98c871331a4c560518cbfbf05cc55c5811f..cf5ec0a7d1df502a7297636ed9d51ddcd061c079 100644 (file)
@@ -34,7 +34,7 @@ void calculate_player_respawn_time();
 
 void ClientKill_Now_TeamChange();
 
 
 void ClientKill_Now_TeamChange();
 
-void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void PlayerDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 
 .float muted; // to be used by prvm_edictset server playernumber muted 1
 float Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol);
 
 .float muted; // to be used by prvm_edictset server playernumber muted 1
 float Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol);
@@ -72,4 +72,4 @@ void PlayerSound(.string samplefield, float chan, float voicetype);
 void VoiceMessage(string type, string msg);
 
 void MoveToTeam(entity client, float team_colour, float type);
 void VoiceMessage(string type, string msg);
 
 void MoveToTeam(entity client, float team_colour, float type);
-#endif
\ No newline at end of file
+#endif
index 665f9a31461c0318ac1fd10e2dc004412728484c..eb5450252140199534f708371825b0254d946e57 100644 (file)
@@ -411,9 +411,7 @@ void CommonCommand_records(float request, entity caller)
        {
                case CMD_REQUEST_COMMAND:
                {
        {
                case CMD_REQUEST_COMMAND:
                {
-                       float i;
-
-                       for(i = 0; i < 10; ++i)
+                       for(int i = 0; i < 10; ++i)
                                if(records_reply[i] != "")
                                        print_to(caller, records_reply[i]);
 
                                if(records_reply[i] != "")
                                        print_to(caller, records_reply[i]);
 
index 45743d811e14414866518e9ecd9e426bf165184a..aa8efd6d69a15934416371d6066b76c419bfc212 100644 (file)
@@ -125,7 +125,7 @@ string getrankings()
 
 string getladder()
 {
 
 string getladder()
 {
-       float i, j, k, uidcnt = 0, thiscnt;
+       int i, j, k, uidcnt = 0, thiscnt;
        string s, temp_s, rr, myuid, thisuid;
 
        rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
        string s, temp_s, rr, myuid, thisuid;
 
        rr = (g_cts) ? CTS_RECORD : RACE_RECORD;
@@ -301,7 +301,7 @@ string getladder()
 string getmaplist()
 {
        string maplist = "", col;
 string getmaplist()
 {
        string maplist = "", col;
-       float i, argc;
+       int i, argc;
 
        argc = tokenize_console(autocvar_g_maplist);
        for(i = 0; i < argc; ++i)
 
        argc = tokenize_console(autocvar_g_maplist);
        for(i = 0; i < argc; ++i)
@@ -356,9 +356,8 @@ string getlsmaps()
 string getmonsterlist()
 {
        string monsterlist = "", col;
 string getmonsterlist()
 {
        string monsterlist = "", col;
-       float i;
 
 
-       for(i = MON_FIRST; i <= MON_LAST; ++i)
+       for(int i = MON_FIRST; i <= MON_LAST; ++i)
        {
                if(i % 2) { col = "^2"; }
                else { col = "^3"; }
        {
                if(i % 2) { col = "^2"; }
                else { col = "^3"; }
index 77ed76024c70ab67f0bed8778626240c73024f35..0e419fdea3ca94a327d90843bbfeb7cdfa8380e6 100644 (file)
@@ -7,9 +7,9 @@
 // ======================================================
 
 // ladder bullshit todo
 // ======================================================
 
 // ladder bullshit todo
-const float LADDER_FIRSTPOINT = 100;
+const int LADDER_FIRSTPOINT = 100;
 #define LADDER_CNT 10 // position X still gives LADDER_FIRSTPOINT/X points
 #define LADDER_CNT 10 // position X still gives LADDER_FIRSTPOINT/X points
-const float LADDER_SIZE = 30;  // ladder shows the top X players
+const int LADDER_SIZE = 30;    // ladder shows the top X players
 
 string top_uids[LADDER_SIZE];
 float top_scores[LADDER_SIZE];
 
 string top_uids[LADDER_SIZE];
 float top_scores[LADDER_SIZE];
@@ -21,4 +21,4 @@ string getladder(void);
 string getmaplist(void);
 string getlsmaps(void);
 string getmonsterlist(void);
 string getmaplist(void);
 string getlsmaps(void);
 string getmonsterlist(void);
-#endif
\ No newline at end of file
+#endif
index 1c3332b714e46d8ebc6587055e20be3625110efb..118fbd4924d6d1d4b2845049bd742a1c31aadb7f 100644 (file)
@@ -163,7 +163,7 @@ float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, flo
 
        return c / q;
 }
 
        return c / q;
 }
-void sharpen_set(float x, float v)
+void sharpen_set(int x, float v)
 {
        sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
 }
 {
        sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
 }
@@ -181,8 +181,7 @@ float sharpen_getpixel(float x, float y)
 }
 float sharpen_get(float x, float a)
 {
 }
 float sharpen_get(float x, float a)
 {
-       float sum;
-       sum = sharpen_getpixel(x, 1);
+       float sum = sharpen_getpixel(x, 1);
        if(a == 0)
                return sum;
        sum *= (8 + 1/a);
        if(a == 0)
                return sum;
        sum *= (8 + 1/a);
@@ -196,20 +195,18 @@ float sharpen_get(float x, float a)
        sum -= sharpen_getpixel(x, 2);
        return bound(0, sum * a, 1);
 }
        sum -= sharpen_getpixel(x, 2);
        return bound(0, sum * a, 1);
 }
-void sharpen_shift(float w)
+void sharpen_shift(int w)
 {
 {
-       float i;
-       for(i = 0; i < w; ++i)
+       for(int i = 0; i < w; ++i)
        {
                sharpen_buffer[i] = sharpen_buffer[i + RADAR_WIDTH_MAX];
                sharpen_buffer[i + RADAR_WIDTH_MAX] = sharpen_buffer[i + 2 * RADAR_WIDTH_MAX];
                sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
        }
 }
        {
                sharpen_buffer[i] = sharpen_buffer[i + RADAR_WIDTH_MAX];
                sharpen_buffer[i + RADAR_WIDTH_MAX] = sharpen_buffer[i + 2 * RADAR_WIDTH_MAX];
                sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
        }
 }
-void sharpen_init(float w)
+void sharpen_init(int w)
 {
 {
-       float i;
-       for(i = 0; i < w; ++i)
+       for(int i = 0; i < w; ++i)
        {
                sharpen_buffer[i] = 0;
                sharpen_buffer[i + RADAR_WIDTH_MAX] = 0;
        {
                sharpen_buffer[i] = 0;
                sharpen_buffer[i + RADAR_WIDTH_MAX] = 0;
index d3a97dd491f8be9ed04db239afa065c450d5e919..c2b068c7d1a9f2a01e86f8dcf9b5531ab2fc702d 100644 (file)
@@ -7,11 +7,11 @@
 
 entity radarmapper;
 
 
 entity radarmapper;
 
-const float RADAR_WIDTH_MAX = 512;
-const float RADAR_HEIGHT_MAX = 512;
+const int RADAR_WIDTH_MAX = 512;
+const int RADAR_HEIGHT_MAX = 512;
 float sharpen_buffer[RADAR_WIDTH_MAX * 3];
 
 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
 // FF is contained twice, to map 256 to FF too
 // removes the need to bound()
 float sharpen_buffer[RADAR_WIDTH_MAX * 3];
 
 string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
 // FF is contained twice, to map 256 to FF too
 // removes the need to bound()
-#endif
\ No newline at end of file
+#endif
index 718c0e5600a9a282c09b8b7f4cf14e6e1cd456ab..3825e655352ff70b3f56b323b642316f14ada2e7 100644 (file)
@@ -504,7 +504,7 @@ void GameCommand_cointoss(float request, float argc)
                        string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
                        string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
                        string choice = ((random() > 0.5) ? result1 : result2);
                        string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
                        string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
                        string choice = ((random() > 0.5) ? result1 : result2);
-                       
+
                        Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
                        return;
                }
                        Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
                        return;
                }
@@ -1379,7 +1379,8 @@ void GameCommand_shuffleteams(float request)
                        if(teamplay)
                        {
                                entity tmp_player;
                        if(teamplay)
                        {
                                entity tmp_player;
-                               float i, x, z, t_teams, t_players, team_color;
+                               int i;
+                               float x, z, t_teams, t_players, team_color;
 
                                // count the total amount of players and total amount of teams
                                t_players = 0;
 
                                // count the total amount of players and total amount of teams
                                t_players = 0;
index b25449b91c725e1e9e110f5e6aef31e832ed1b13..a0b3fec6eee05328edec934346d6a961516f76be 100644 (file)
@@ -28,7 +28,7 @@
 //  Nagger for players to know status of voting
 float Nagger_SendEntity(entity to, float sendflags)
 {
 //  Nagger for players to know status of voting
 float Nagger_SendEntity(entity to, float sendflags)
 {
-       float nags, i, f, b;
+       int nags, i, f, b;
        entity e;
        WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
 
        entity e;
        WriteByte(MSG_ENTITY, ENT_CLIENT_NAGGER);
 
index 91e460eca7d734840f5dbe05641c232e2f0342a2..1d4cc55232382a6fcd7f2491325b6364ec5a9736 100644 (file)
@@ -1,27 +1,27 @@
 #ifndef SERVER_CONSTANTS_H
 #define SERVER_CONSTANTS_H
 
 #ifndef SERVER_CONSTANTS_H
 #define SERVER_CONSTANTS_H
 
-const float FL_WEAPON = 8192;
-const float FL_POWERUP = 16384;
-const float FL_PROJECTILE = 32768;
-const float FL_TOSSED = 65536;
-const float FL_NO_WEAPON_STAY = 131072;
-const float FL_SPAWNING = 262144;
+const int FL_WEAPON = 8192;
+const int FL_POWERUP = 16384;
+const int FL_PROJECTILE = 32768;
+const int FL_TOSSED = 65536;
+const int FL_NO_WEAPON_STAY = 131072;
+const int FL_SPAWNING = 262144;
 
 
-const float SVC_SOUND = 6;
-const float SVC_STOPSOUND = 16;
-const float SVC_SETVIEW = 5;
+const int SVC_SOUND = 6;
+const int SVC_STOPSOUND = 16;
+const int SVC_SETVIEW = 5;
 
 
-const float RESPAWN_FORCE = 1;
-const float RESPAWN_SILENT = 2;
+const int RESPAWN_FORCE = 1;
+const int RESPAWN_SILENT = 2;
 
 #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
 
 
 #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)
 
-const float MSG_ENTITY = 5; // csqc
+const int MSG_ENTITY = 5; // csqc
 
 
-const float NUM_PLAYERSKINS_TEAMPLAY = 3;
+const int NUM_PLAYERSKINS_TEAMPLAY = 3;
 
 
-const float ASSAULT_VALUE_INACTIVE = 1000;
+const int ASSAULT_VALUE_INACTIVE = 1000;
 
 
-const float DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
-#endif
\ No newline at end of file
+const int DOOR_NOSPLASH = 256; // generic anti-splashdamage spawnflag
+#endif
index c49af0d8f21fa3760a11f05ca64ee6696182fefc..175179b50797d5a5ede5cffd8352f19eb602cfc3 100644 (file)
@@ -106,7 +106,7 @@ float server_is_dedicated;
 //.float cnt2;
 
 .float play_time;
 //.float cnt2;
 
 .float play_time;
-.float respawn_flags;
+.int respawn_flags;
 .float respawn_time;
 .float respawn_time_max;
 .float death_time;
 .float respawn_time;
 .float respawn_time_max;
 .float death_time;
@@ -183,8 +183,8 @@ const float MAX_DAMAGEEXTRARADIUS = 16;
 .vector weaponentity_glowmod;
 
 //.int weapon; // current weapon
 .vector weaponentity_glowmod;
 
 //.int weapon; // current weapon
-.float switchweapon; // weapon requested to switch to
-.float switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
+.int switchweapon; // weapon requested to switch to
+.int switchingweapon; // weapon currently being switched to (is copied from switchweapon once switch is possible)
 .string weaponname; // name of .weapon
 
 // WEAPONTODO
 .string weaponname; // name of .weapon
 
 // WEAPONTODO
@@ -199,14 +199,14 @@ void w_ready();
 
 
 // weapon states (self.weaponentity.state)
 
 
 // weapon states (self.weaponentity.state)
-const float WS_CLEAR                   = 0; // no weapon selected
-const float WS_RAISE                   = 1; // raise frame
-const float WS_DROP                            = 2; // deselecting frame
-const float WS_INUSE                   = 3; // fire state
-const float WS_READY                   = 4; // idle frame
+const int WS_CLEAR                     = 0; // no weapon selected
+const int WS_RAISE                     = 1; // raise frame
+const int WS_DROP                              = 2; // deselecting frame
+const int WS_INUSE                     = 3; // fire state
+const int WS_READY                     = 4; // idle frame
 
 // there is 2 weapon tics that can run in one server frame
 
 // there is 2 weapon tics that can run in one server frame
-const float W_TICSPERFRAME = 2;
+const int W_TICSPERFRAME = 2;
 
 void weapon_defaultspawnfunc(float wpn);
 
 
 void weapon_defaultspawnfunc(float wpn);
 
@@ -284,7 +284,7 @@ float default_weapon_alpha;
 
 .float version_nagtime;
 
 
 .float version_nagtime;
 
-const float NUM_JUMPPADSUSED = 3;
+const int NUM_JUMPPADSUSED = 3;
 .float jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
 
 .float jumppadcount;
 .entity jumppadsused[NUM_JUMPPADSUSED];
 
@@ -432,7 +432,7 @@ float independent_players;
 
 string clientstuff;
 .float phase;
 
 string clientstuff;
 .float phase;
-.float pressedkeys;
+.int pressedkeys;
 
 .float porto_forbidden;
 
 
 .float porto_forbidden;
 
@@ -515,7 +515,7 @@ string matchid;
 .float hit_time;
 .float typehit_time;
 
 .float hit_time;
 .float typehit_time;
 
-.float damage_dealt_total; 
+.float damage_dealt_total;
 
 .float stat_leadlimit;
 
 
 .float stat_leadlimit;
 
@@ -623,4 +623,4 @@ const int MIF_GUIDED_TAG = 128;
 .string playernick;
 .float elos;
 .float ranks;
 .string playernick;
 .float elos;
 .float ranks;
-#endif
\ No newline at end of file
+#endif
index 9188418bdc204ecad1f9d5dc8bb30a157eda4244..98ec277683c5477912cc1415f234c284a80754b5 100644 (file)
@@ -48,7 +48,7 @@ float entcs_customize()
        return true;
 }
 
        return true;
 }
 
-float entcs_send(entity to, float sf)
+float entcs_send(entity to, int sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
        WriteByte(MSG_ENTITY, sf);
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
        WriteByte(MSG_ENTITY, sf);
index 0d11f5cb2758cdacc2944a42fa05163379922fdb..05821f9ba3081b9ff19694940ae5662f581fd000 100644 (file)
@@ -22,11 +22,11 @@ void entcs_init();
 
 float entcs_customize();
 
 
 float entcs_customize();
 
-float entcs_send(entity to, float sf);
+float entcs_send(entity to, int sf);
 
 void entcs_think();
 
 entity attach_entcs();
 
 void detach_entcs();
 
 void entcs_think();
 
 entity attach_entcs();
 
 void detach_entcs();
-#endif
\ No newline at end of file
+#endif
index 10a0ed2c2f683793d8b37ef7113ec2c95011bf71..c0e54d11671093d0201ed5d51cd389d4d4859406 100644 (file)
@@ -33,7 +33,7 @@
 //   Otherwise mdl_dead will be displayed at the map origin, and nobody would
 //   want that!
 
 //   Otherwise mdl_dead will be displayed at the map origin, and nobody would
 //   want that!
 
-void func_breakable_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void func_breakable_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
 
 //
 // func_breakable
 
 //
 // func_breakable
@@ -79,7 +79,7 @@ void func_breakable_colormod()
                self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
        else
                self.colormod = '1 1 1';
                self.colormod = '1 0 0' + '0 1 0' * (2 * h - 0.5);
        else
                self.colormod = '1 1 1';
-               
+
        CSQCMODEL_AUTOUPDATE();
 }
 
        CSQCMODEL_AUTOUPDATE();
 }
 
@@ -142,7 +142,7 @@ void func_breakable_destroyed()
 {
        func_breakable_look_destroyed();
        func_breakable_behave_destroyed();
 {
        func_breakable_look_destroyed();
        func_breakable_behave_destroyed();
-       
+
        CSQCMODEL_AUTOUPDATE();
 }
 
        CSQCMODEL_AUTOUPDATE();
 }
 
@@ -150,7 +150,7 @@ void func_breakable_restore()
 {
        func_breakable_look_restore();
        func_breakable_behave_restore();
 {
        func_breakable_look_restore();
        func_breakable_behave_restore();
-       
+
        CSQCMODEL_AUTOUPDATE();
 }
 
        CSQCMODEL_AUTOUPDATE();
 }
 
@@ -190,7 +190,7 @@ void func_breakable_destroy() {
        self.message = oldmsg;
 }
 
        self.message = oldmsg;
 }
 
-void func_breakable_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void func_breakable_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(self.state == 1)
                return;
 {
        if(self.state == 1)
                return;
@@ -223,7 +223,7 @@ void func_breakable_reset()
                func_breakable_behave_destroyed();
        else
                func_breakable_behave_restore();
                func_breakable_behave_destroyed();
        else
                func_breakable_behave_restore();
-               
+
        CSQCMODEL_AUTOUPDATE();
 }
 
        CSQCMODEL_AUTOUPDATE();
 }
 
@@ -276,7 +276,7 @@ void spawnfunc_func_breakable() {
 
        self.reset = func_breakable_reset;
        func_breakable_reset();
 
        self.reset = func_breakable_reset;
        func_breakable_reset();
-       
+
        CSQCMODEL_AUTOINIT();
 }
 
        CSQCMODEL_AUTOINIT();
 }
 
index c58af4ade282e315de3fd779281384b1e680683f..2b78ebe0b2d309b5d33ef93768a3ba6cae4ce699 100644 (file)
@@ -22,7 +22,7 @@ float Casing_SendEntity(entity to, float sf)
        return true;
 }
 
        return true;
 }
 
-void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype, entity casingowner)
+void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner)
 {
        entity e;
        vector org;
 {
        entity e;
        vector org;
index a38d6046a4091b6d3ceb34e7d49468654832a09e..d20cb168fa39dd00c6e5f22e004094d7102a4e0d 100644 (file)
@@ -221,7 +221,7 @@ float g_weaponspreadfactor;
 WepSet start_weapons;
 WepSet start_weapons_default;
 WepSet start_weapons_defaultmask;
 WepSet start_weapons;
 WepSet start_weapons_default;
 WepSet start_weapons_defaultmask;
-float start_items;
+int start_items;
 float start_ammo_shells;
 float start_ammo_nails;
 float start_ammo_rockets;
 float start_ammo_shells;
 float start_ammo_nails;
 float start_ammo_rockets;
@@ -246,8 +246,8 @@ float g_weapon_stay;
 
 float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
 {
 
 float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
 {
-       float i = weaponinfo.weapon;
-       float d = 0;
+       int i = weaponinfo.weapon;
+       int d = 0;
 
        if (!i)
                return 0;
 
        if (!i)
                return 0;
@@ -395,7 +395,7 @@ void readplayerstartcvars()
                for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        e = get_weaponinfo(i);
                for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        e = get_weaponinfo(i);
-                       float w = want_weapon(e, false);
+                       int w = want_weapon(e, false);
                        if(w & 1)
                                start_weapons |= WepSet_FromWeapon(i);
                        if(w & 2)
                        if(w & 1)
                                start_weapons |= WepSet_FromWeapon(i);
                        if(w & 2)
@@ -457,7 +457,7 @@ void readplayerstartcvars()
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               float w = want_weapon(e, g_warmup_allguns);
+                               int w = want_weapon(e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
@@ -683,4 +683,4 @@ void InitializeEntity(entity e, void(void) func, float order);
 void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer);
 void Net_LinkEntity(entity e, float docull, float dt, float(entity, float) sendfunc);
 
 void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer);
 void Net_LinkEntity(entity e, float docull, float dt, float(entity, float) sendfunc);
 
-#endif
\ No newline at end of file
+#endif
index 6f306ae383781c212b3e45649d938f884e65c396..330707e67c949bf097192658d2c0d57c8a2048bb 100644 (file)
@@ -5,11 +5,11 @@
 .entity assault_sprite;
 
 // legacy bot defs
 .entity assault_sprite;
 
 // legacy bot defs
-const float HAVOCBOT_AST_ROLE_NONE = 0;
-const float HAVOCBOT_AST_ROLE_DEFENSE = 2;
-const float HAVOCBOT_AST_ROLE_OFFENSE = 4;
+const int HAVOCBOT_AST_ROLE_NONE = 0;
+const int HAVOCBOT_AST_ROLE_DEFENSE = 2;
+const int HAVOCBOT_AST_ROLE_OFFENSE = 4;
 
 
-.float havocbot_role_flags;
+.int havocbot_role_flags;
 .float havocbot_attack_time;
 
 .void() havocbot_role;
 .float havocbot_attack_time;
 
 .void() havocbot_role;
@@ -31,4 +31,4 @@ const float SP_ASSAULT_OBJECTIVES = 4;
 // predefined spawnfuncs
 void spawnfunc_func_breakable();
 void target_objective_decrease_activate();
 // predefined spawnfuncs
 void spawnfunc_func_breakable();
 void target_objective_decrease_activate();
-#endif
\ No newline at end of file
+#endif
index d66da5a0e53497f6a5048ce173e6ea7ed12c3b00..5e80483b96bff6ddeba62aa3cb97870015abd406 100644 (file)
@@ -15,4 +15,4 @@
 var float(string name) cvar;
 var string(string name) cvar_string;
 var void(string name, string value) cvar_set;
 var float(string name) cvar;
 var string(string name) cvar_string;
 var void(string name, string value) cvar_set;
-#endif
\ No newline at end of file
+#endif
index 8e5bd337525ad7b90a204c56578c73f31338a6fe..b31194fb9a4e0ada97f1b0bbd5d86a43edb7ef38 100644 (file)
@@ -11,4 +11,4 @@
 #define cvar builtin_cvar
 
 #pragma noref 1
 #define cvar builtin_cvar
 
 #pragma noref 1
-#endif
\ No newline at end of file
+#endif
index 9e215747a1da4430cde952a0f3fe9c8203eb1bff..92af1cdd093b0733fe922e4423d96da706693457 100644 (file)
@@ -171,10 +171,8 @@ void trigger_push_touch()
                }
                if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
                {
                }
                if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
                {
-                       float i;
-                       float found;
-                       found = false;
-                       for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
+                       bool found = false;
+                       for(int i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i)
                                if(other.(jumppadsused[i]) == self)
                                        found = true;
                        if(!found)
                                if(other.(jumppadsused[i]) == self)
                                        found = true;
                        if(!found)
index 4c477c28ffbfcf11edab3093c479d43fa08e351e..2557d10d1599d1a3eec2a32457387b4f84048841 100644 (file)
@@ -23,9 +23,9 @@ float accuracy_byte(float n, float d)
        return 1 + rint(n * 100.0 / d);
 }
 
        return 1 + rint(n * 100.0 / d);
 }
 
-float accuracy_send(entity to, float sf)
+float accuracy_send(entity to, int sf)
 {
 {
-       float w, f;
+       int w, f;
        entity a;
        WriteByte(MSG_ENTITY, ENT_CLIENT_ACCURACY);
 
        entity a;
        WriteByte(MSG_ENTITY, ENT_CLIENT_ACCURACY);
 
@@ -79,7 +79,7 @@ void accuracy_resend(entity e)
 .float hit_time;
 .float fired_time;
 
 .float hit_time;
 .float fired_time;
 
-void accuracy_add(entity e, float w, float fired, float hit)
+void accuracy_add(entity e, int w, float fired, float hit)
 {
        entity a;
        float b;
 {
        entity a;
        float b;
index bc7413033b0b4ed08cd78c1bd0700207bf7e3d8b..773b7f085bea4e9c275501429895d251d176fca6 100644 (file)
@@ -13,7 +13,7 @@
 
 .float csqcprojectile_type;
 
 
 .float csqcprojectile_type;
 
-float CSQCProjectile_SendEntity(entity to, float sf)
+float CSQCProjectile_SendEntity(entity to, int sf)
 {
        float ft, fr;
 
 {
        float ft, fr;
 
@@ -81,7 +81,7 @@ void CSQCProjectile_Check(entity e)
        e.csqcprojectile_oldorigin = e.origin;
 }
 
        e.csqcprojectile_oldorigin = e.origin;
 }
 
-void CSQCProjectile(entity e, float clientanimate, float type, float docull)
+void CSQCProjectile(entity e, float clientanimate, int type, float docull)
 {
        Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
 
 {
        Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
 
index 56bab19a450bd19a9b05f375310623104d4c58b1..5ea0a5d9d842c8690cdf979cd7a9c717e5439477 100644 (file)
@@ -33,7 +33,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
 
        if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
                complain = 0;
 
        if(wpn == WEP_HOOK && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
                complain = 0;
-               
+
        if(complain)
                self.hasweapon_complain_spam = time + 0.2;
 
        if(complain)
                self.hasweapon_complain_spam = time + 0.2;
 
@@ -123,8 +123,7 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
 {
        // We cannot tokenize in this function, as GiveItems calls this
        // function. Thus we must use car/cdr.
 {
        // We cannot tokenize in this function, as GiveItems calls this
        // function. Thus we must use car/cdr.
-       float weaponwant, first_valid, prev_valid, switchtonext, switchtolast, c;
-       string rest;
+       float weaponwant, first_valid, prev_valid, switchtonext, switchtolast;
        WepSet wepset = '0 0 0';
        switchtonext = switchtolast = 0;
        first_valid = prev_valid = 0;
        WepSet wepset = '0 0 0';
        switchtonext = switchtolast = 0;
        first_valid = prev_valid = 0;
@@ -139,9 +138,9 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa
        if(dir == 0)
                switchtonext = 1;
 
        if(dir == 0)
                switchtonext = 1;
 
-       c = 0;
+       int c = 0;
 
 
-       rest = weaponorder;
+       string rest = weaponorder;
        while(rest != "")
        {
                weaponwant = stof(car(rest)); rest = cdr(rest);
        while(rest != "")
        {
                weaponwant = stof(car(rest)); rest = cdr(rest);
index 21ca14d95f850c7ecaeba3c462e53d1582eb5f6e..69f644c70a0f1e65dde06150f69d03996a762be7 100644 (file)
@@ -7,7 +7,7 @@ void Send_WeaponComplain(entity e, float wpn, float type);
 .float hasweapon_complain_spam;
 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
 
 .float hasweapon_complain_spam;
 float client_hasweapon(entity cl, float wpn, float andammo, float complain);
 
-.float weaponcomplainindex;
+.int weaponcomplainindex;
 float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing);
 
 #define w_getbestweapon(ent) W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true)
 float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, float complain, float skipmissing);
 
 #define w_getbestweapon(ent) W_GetCycleWeapon(ent, ent.cvar_cl_weaponpriority, 0, -1, false, true)
@@ -30,4 +30,4 @@ void W_PreviousWeapon(float list);
 
 // previously used if exists and has ammo, (second) best otherwise
 void W_LastWeapon(void);
 
 // previously used if exists and has ammo, (second) best otherwise
 void W_LastWeapon(void);
-#endif
\ No newline at end of file
+#endif
index 0cd3d6d82a8fb67efd20ebff37efb0054c3b282e..ea62fcf19eba9c05d08169e827357b879ef3ba9a 100644 (file)
@@ -23,7 +23,7 @@ string W_Apply_Weaponreplace(string in)
        {
                replacement = "";
                s = argv(i);
        {
                replacement = "";
                s = argv(i);
-               
+
                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
@@ -48,7 +48,7 @@ void weapon_defaultspawnfunc(float wpn)
        string s;
        entity oldself;
        float i, j;
        string s;
        entity oldself;
        float i, j;
-       float f;
+       int f;
 
        if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
        {
 
        if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
        {
index f187b838b46fbdb256e4aeb5abdea8c4d9f2d24f..3085af1205e389b7d2cf98073e99388745b69bcb 100644 (file)
@@ -76,7 +76,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
 
        //vector prevdir = w_shotdir;
        //vector prevorg = w_shotorg;
 
        //vector prevdir = w_shotdir;
        //vector prevorg = w_shotorg;
-       //vector prevend = w_shotend; 
+       //vector prevend = w_shotend;
 
        if (antilag)
        if (!ent.cvar_cl_noantilag)
 
        if (antilag)
        if (!ent.cvar_cl_noantilag)
@@ -173,9 +173,9 @@ void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float p
        }
        mspercallsum -= gettime(GETTIME_HIRES);
        #endif
        }
        mspercallsum -= gettime(GETTIME_HIRES);
        #endif
-       
+
        dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
        dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style);
-       
+
        #if 0
        mspercallsum += gettime(GETTIME_HIRES);
        mspercallcount += 1;
        #if 0
        mspercallsum += gettime(GETTIME_HIRES);
        mspercallcount += 1;
@@ -341,7 +341,7 @@ void fireBullet_trace_callback(vector start, vector hit, vector end)
        fireBullet_last_hit = world;
 }
 
        fireBullet_last_hit = world;
 }
 
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects)
+void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects)
 {
        vector  end;
 
 {
        vector  end;
 
index 74662d19585265d1f296f78d0e7e099e38828bdb..1cab448cb087da8bd89bff9243cd6aebdcf78f37 100644 (file)
@@ -55,5 +55,5 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 float fireBullet_trace_callback_eff;
 entity fireBullet_last_hit;
 void fireBullet_trace_callback(vector start, vector hit, vector end);
 float fireBullet_trace_callback_eff;
 entity fireBullet_last_hit;
 void fireBullet_trace_callback(vector start, vector hit, vector end);
-void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects);
-#endif
\ No newline at end of file
+void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, int tracereffects);
+#endif
index 1f34034761b894111125f368e5a8b45c66f9b095..ab85389c5c9dc675e84f4917e21a6c08cf47eb03 100644 (file)
@@ -281,7 +281,7 @@ vector CL_Weapon_GetShotOrg(float wpn)
 
 void CL_Weaponentity_Think()
 {
 
 void CL_Weaponentity_Think()
 {
-       float tb;
+       int tb;
        self.nextthink = time;
        if (intermission_running)
                self.frame = self.anim_idle.x;
        self.nextthink = time;
        if (intermission_running)
                self.frame = self.anim_idle.x;