From: TimePath Date: Thu, 29 Jan 2015 23:09:25 +0000 (+1100) Subject: Declare more ints as ints X-Git-Tag: xonotic-v0.8.1~133^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=390d33b5f587dc807ae08ffe39adc1d762fc7f4c;p=xonotic%2Fxonotic-data.pk3dir.git Declare more ints as ints --- diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index 167fd2141..16a7645fd 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -36,8 +36,8 @@ float complain_weapon_time; 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; @@ -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(); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 3b36a12c0..b8823e629 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -99,9 +99,9 @@ float button_zoom; 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; @@ -149,4 +149,4 @@ entity entcs_receiver[255]; // 255 is the engine limit on maxclients float hud; float view_quality; int framecount; -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/campaign_file.qc b/qcsrc/common/campaign_file.qc index 27319ec7c..69dbb0b1d 100644 --- a/qcsrc/common/campaign_file.qc +++ b/qcsrc/common/campaign_file.qc @@ -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 -float CampaignFile_Load(float offset, float n) +float CampaignFile_Load(int offset, float n) { float fh; float lineno; diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 41c146831..43e81cbf9 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -1415,7 +1415,7 @@ void MapInfo_Shutdown() } } -float MapInfo_ForbiddenFlags() +int MapInfo_ForbiddenFlags() { int f = MAPINFO_FLAG_FORBIDDEN; @@ -1430,7 +1430,7 @@ float MapInfo_ForbiddenFlags() return f; } -float MapInfo_RequiredFlags() +int MapInfo_RequiredFlags() { int f = 0; diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 03ad44870..6083350fa 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -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_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 @@ -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* +*" -#endif \ No newline at end of file +#endif diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 4a4f63686..27a7bb6ec 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -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); } - + 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); } } - + 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) @@ -63,7 +63,7 @@ void PlayerStats_GameReport_AddTeam(float t) string key = sprintf("%d", t); string p = db_get(PS_GR_OUT_DB, key); - + 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); - + 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; } - + 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)); } - // 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)); } @@ -401,7 +401,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status) url_fclose(fh); break; } - + case URL_READY_CLOSED: { // url_fclose has finished @@ -414,7 +414,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status) } break; } - + case URL_READY_ERROR: default: { @@ -523,7 +523,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status) url_fclose(fh); break; } - + 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; } - + 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); } - else { db_put(PS_D_IN_DB, marker, "#"); } + else { db_put(PS_D_IN_DB, 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; } - + 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; } - + if(count == 2) { key = argv(0); @@ -773,7 +773,7 @@ void PlayerStats_PlayerDetail_Handler(entity fh, entity unused, float status) } break; } - + default: { printf( diff --git a/qcsrc/common/test.qc b/qcsrc/common/test.qc index a9360913e..966553b27 100644 --- a/qcsrc/common/test.qc +++ b/qcsrc/common/test.qc @@ -24,10 +24,9 @@ void TEST_OK() float TEST_RunAll() { - float f = 0; + int f = 0; 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_") diff --git a/qcsrc/dpdefs/dpextensions.qh b/qcsrc/dpdefs/dpextensions.qh index c27d9903f..26d351a20 100644 --- a/qcsrc/dpdefs/dpextensions.qh +++ b/qcsrc/dpdefs/dpextensions.qh @@ -275,7 +275,7 @@ float EF_DELTA = 8388608; //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). @@ -2352,7 +2352,7 @@ string(float n) argv = #442; //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) @@ -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 -#endif \ No newline at end of file +#endif diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 94d167e5e..e9f3538ff 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -12,7 +12,7 @@ float mouseButtonsPressed; vector menuMousePos; -float menuShiftState; +int menuShiftState; float menuPrevTime; float menuAlpha; float menuLogoAlpha; diff --git a/qcsrc/menu/menu.qh b/qcsrc/menu/menu.qh index 4ff32361e..2aa2b5d6c 100644 --- a/qcsrc/menu/menu.qh +++ b/qcsrc/menu/menu.qh @@ -19,18 +19,18 @@ // 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; -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; @@ -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(); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/menu/xonotic/dialog_settings_effects.qc b/qcsrc/menu/xonotic/dialog_settings_effects.qc index 7ec7ba027..811cb0998 100644 --- a/qcsrc/menu/xonotic/dialog_settings_effects.qc +++ b/qcsrc/menu/xonotic/dialog_settings_effects.qc @@ -7,7 +7,6 @@ CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab) ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.2) // added extra .2 for center space ENDCLASS(XonoticEffectsSettingsTab) entity makeXonoticEffectsSettingsTab(); -float updateCompression(); #endif #ifdef IMPLEMENTATION diff --git a/qcsrc/menu/xonotic/util.qc b/qcsrc/menu/xonotic/util.qc index 0eb5b215c..0846526d0 100644 --- a/qcsrc/menu/xonotic/util.qc +++ b/qcsrc/menu/xonotic/util.qc @@ -329,8 +329,8 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data) n = tokenizebyseparator(data, "\n"); float i; - string s; - + string s; + 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 = ""; - + 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": @@ -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); diff --git a/qcsrc/menu/xonotic/util.qh b/qcsrc/menu/xonotic/util.qh index 3f24d1d84..64072977f 100644 --- a/qcsrc/menu/xonotic/util.qh +++ b/qcsrc/menu/xonotic/util.qh @@ -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); -float tooltipdb; +int tooltipdb; 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); @@ -54,4 +56,4 @@ string _Nex_ExtResponseSystem_RecommendedServers; float _Nex_ExtResponseSystem_RecommendedServersNeedsRefresh; void CheckSendCvars(entity me, string cvarnamestring); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/antilag.qc b/qcsrc/server/antilag.qc index ee91fb792..6f8f0f487 100644 --- a/qcsrc/server/antilag.qc +++ b/qcsrc/server/antilag.qc @@ -7,10 +7,10 @@ #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]; -.float antilag_index; +.int antilag_index; .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) { - 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; @@ -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; - 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; diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index f60741463..0acd32993 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -264,7 +264,7 @@ void bot_setnameandstuff() void bot_custom_weapon_priority_setup() { - float tokens, i, c, w; + float tokens, i, w; 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)," "); - 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) { diff --git a/qcsrc/server/bot/bot.qh b/qcsrc/server/bot/bot.qh index 8eafb93ba..bcae58dc1 100644 --- a/qcsrc/server/bot/bot.qh +++ b/qcsrc/server/bot/bot.qh @@ -4,21 +4,21 @@ * 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 aistatus; +.int aistatus; // 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); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 0d92acbd2..0ecafaf1e 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -941,7 +941,7 @@ void havocbot_chooseenemy() 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. @@ -968,7 +968,7 @@ float havocbot_chooseweapon_checkreload(float new_weapon) void havocbot_chooseweapon() { - float i; + int i; // ;) if(g_weaponarena_weapons == WEPSET_TUBA) @@ -994,8 +994,8 @@ void havocbot_chooseweapon() } // 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; diff --git a/qcsrc/server/bot/havocbot/role_onslaught.qc b/qcsrc/server/bot/havocbot/role_onslaught.qc index 56745fbab..55da31783 100644 --- a/qcsrc/server/bot/havocbot/role_onslaught.qc +++ b/qcsrc/server/bot/havocbot/role_onslaught.qc @@ -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; @@ -97,7 +97,7 @@ void havocbot_role_ons_setrole(entity bot, float role) dprint("\n"); } -float havocbot_ons_teamcount(entity bot, float role) +float havocbot_ons_teamcount(entity bot, int role) { float c = 0; entity head; diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/havocbot/roles.qc index 870cf295d..af219b8ec 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/havocbot/roles.qc @@ -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; - 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; diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/scripting.qc index 60bb02b65..16a015c8d 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/scripting.qc @@ -91,7 +91,7 @@ float bot_havecommand(entity bot, float idx) 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]; @@ -100,7 +100,7 @@ entity bot_getplace(string placename) 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) @@ -138,35 +138,35 @@ entity bot_getplace(string placename) // 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 @@ -174,13 +174,13 @@ const float BOT_CMD_COUNTER = 24; // Update this value if you add/remove a comm .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_cmd_parm_type[BOT_CMD_COUNTER]; +int bot_cmd_parm_type[BOT_CMD_COUNTER]; 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 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 @@ -321,7 +321,7 @@ entity find_bot_by_number(float number) float bot_decodecommand(string cmdstring) { - float cmd_parm_type, i; + float cmd_parm_type; float sp; string parm; @@ -339,6 +339,7 @@ float bot_decodecommand(string cmdstring) if(!bot_cmds_initialized) bot_commands_init(); + int i; for(i=1;i 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); diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index 40c7e318b..2cc8e0215 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -43,7 +43,7 @@ void ImpulseCommands (void) { - float imp; + int imp; vector org; float i; float m; diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index c022172ed..337342333 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -31,7 +31,7 @@ .entity ladder_entity; .float gravity; .float swamp_slowdown; -.float lastflags; +.int lastflags; .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; - float buttons_prev; + int buttons_prev; float not_allowed_to_move; string c; diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index bd5109fb3..49d1c1b46 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -286,9 +286,10 @@ void calculate_player_respawn_time() 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; @@ -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 - 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; diff --git a/qcsrc/server/cl_player.qh b/qcsrc/server/cl_player.qh index 4479f98c8..cf5ec0a7d 100644 --- a/qcsrc/server/cl_player.qh +++ b/qcsrc/server/cl_player.qh @@ -34,7 +34,7 @@ void calculate_player_respawn_time(); 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); @@ -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); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 665f9a314..eb5450252 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -411,9 +411,7 @@ void CommonCommand_records(float request, entity caller) { 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]); diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index 45743d811..aa8efd6d6 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -125,7 +125,7 @@ string getrankings() 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; @@ -301,7 +301,7 @@ string getladder() string getmaplist() { string maplist = "", col; - float i, argc; + int i, argc; argc = tokenize_console(autocvar_g_maplist); for(i = 0; i < argc; ++i) @@ -356,9 +356,8 @@ string getlsmaps() 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"; } diff --git a/qcsrc/server/command/getreplies.qh b/qcsrc/server/command/getreplies.qh index 77ed76024..0e419fdea 100644 --- a/qcsrc/server/command/getreplies.qh +++ b/qcsrc/server/command/getreplies.qh @@ -7,9 +7,9 @@ // ====================================================== // 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 -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]; @@ -21,4 +21,4 @@ string getladder(void); string getmaplist(void); string getlsmaps(void); string getmonsterlist(void); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index 1c3332b71..118fbd492 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -163,7 +163,7 @@ float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, flo 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; } @@ -181,8 +181,7 @@ float sharpen_getpixel(float x, float y) } 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); @@ -196,20 +195,18 @@ float sharpen_get(float x, float a) 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; } } -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; diff --git a/qcsrc/server/command/radarmap.qh b/qcsrc/server/command/radarmap.qh index d3a97dd49..c2b068c7d 100644 --- a/qcsrc/server/command/radarmap.qh +++ b/qcsrc/server/command/radarmap.qh @@ -7,11 +7,11 @@ 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() -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 718c0e560..3825e6553 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -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); - + 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; - 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; diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index b25449b91..a0b3fec6e 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -28,7 +28,7 @@ // 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); diff --git a/qcsrc/server/constants.qh b/qcsrc/server/constants.qh index 91e460eca..1d4cc5523 100644 --- a/qcsrc/server/constants.qh +++ b/qcsrc/server/constants.qh @@ -1,27 +1,27 @@ #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) -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 diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index c49af0d8f..175179b50 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -106,7 +106,7 @@ float server_is_dedicated; //.float cnt2; .float play_time; -.float respawn_flags; +.int respawn_flags; .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 -.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 @@ -199,14 +199,14 @@ void w_ready(); // 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 -const float W_TICSPERFRAME = 2; +const int W_TICSPERFRAME = 2; void weapon_defaultspawnfunc(float wpn); @@ -284,7 +284,7 @@ float default_weapon_alpha; .float version_nagtime; -const float NUM_JUMPPADSUSED = 3; +const int NUM_JUMPPADSUSED = 3; .float jumppadcount; .entity jumppadsused[NUM_JUMPPADSUSED]; @@ -432,7 +432,7 @@ float independent_players; string clientstuff; .float phase; -.float pressedkeys; +.int pressedkeys; .float porto_forbidden; @@ -515,7 +515,7 @@ string matchid; .float hit_time; .float typehit_time; -.float damage_dealt_total; +.float damage_dealt_total; .float stat_leadlimit; @@ -623,4 +623,4 @@ const int MIF_GUIDED_TAG = 128; .string playernick; .float elos; .float ranks; -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/ent_cs.qc b/qcsrc/server/ent_cs.qc index 9188418bd..98ec27768 100644 --- a/qcsrc/server/ent_cs.qc +++ b/qcsrc/server/ent_cs.qc @@ -48,7 +48,7 @@ float entcs_customize() 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); diff --git a/qcsrc/server/ent_cs.qh b/qcsrc/server/ent_cs.qh index 0d11f5cb2..05821f9ba 100644 --- a/qcsrc/server/ent_cs.qh +++ b/qcsrc/server/ent_cs.qh @@ -22,11 +22,11 @@ void entcs_init(); 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(); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/func_breakable.qc b/qcsrc/server/func_breakable.qc index 10a0ed2c2..c0e54d116 100644 --- a/qcsrc/server/func_breakable.qc +++ b/qcsrc/server/func_breakable.qc @@ -33,7 +33,7 @@ // 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 @@ -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'; - + CSQCMODEL_AUTOUPDATE(); } @@ -142,7 +142,7 @@ void func_breakable_destroyed() { func_breakable_look_destroyed(); func_breakable_behave_destroyed(); - + CSQCMODEL_AUTOUPDATE(); } @@ -150,7 +150,7 @@ void func_breakable_restore() { func_breakable_look_restore(); func_breakable_behave_restore(); - + CSQCMODEL_AUTOUPDATE(); } @@ -190,7 +190,7 @@ void func_breakable_destroy() { 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; @@ -223,7 +223,7 @@ void func_breakable_reset() func_breakable_behave_destroyed(); else func_breakable_behave_restore(); - + CSQCMODEL_AUTOUPDATE(); } @@ -276,7 +276,7 @@ void spawnfunc_func_breakable() { self.reset = func_breakable_reset; func_breakable_reset(); - + CSQCMODEL_AUTOINIT(); } diff --git a/qcsrc/server/g_casings.qc b/qcsrc/server/g_casings.qc index c58af4ade..2b78ebe0b 100644 --- a/qcsrc/server/g_casings.qc +++ b/qcsrc/server/g_casings.qc @@ -22,7 +22,7 @@ float Casing_SendEntity(entity to, float sf) 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; diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index a38d6046a..d20cb168f 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -221,7 +221,7 @@ float g_weaponspreadfactor; 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; @@ -246,8 +246,8 @@ float g_weapon_stay; 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; @@ -395,7 +395,7 @@ void readplayerstartcvars() 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) @@ -457,7 +457,7 @@ void readplayerstartcvars() 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) @@ -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); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/mutators/gamemode_assault.qh b/qcsrc/server/mutators/gamemode_assault.qh index 6f306ae38..330707e67 100644 --- a/qcsrc/server/mutators/gamemode_assault.qh +++ b/qcsrc/server/mutators/gamemode_assault.qh @@ -5,11 +5,11 @@ .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; @@ -31,4 +31,4 @@ const float SP_ASSAULT_OBJECTIVES = 4; // predefined spawnfuncs void spawnfunc_func_breakable(); void target_objective_decrease_activate(); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/sys-post.qh b/qcsrc/server/sys-post.qh index d66da5a0e..5e80483b9 100644 --- a/qcsrc/server/sys-post.qh +++ b/qcsrc/server/sys-post.qh @@ -15,4 +15,4 @@ 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 diff --git a/qcsrc/server/sys-pre.qh b/qcsrc/server/sys-pre.qh index 8e5bd3375..b31194fb9 100644 --- a/qcsrc/server/sys-pre.qh +++ b/qcsrc/server/sys-pre.qh @@ -11,4 +11,4 @@ #define cvar builtin_cvar #pragma noref 1 -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/t_jumppads.qc b/qcsrc/server/t_jumppads.qc index 9e215747a..92af1cdd0 100644 --- a/qcsrc/server/t_jumppads.qc +++ b/qcsrc/server/t_jumppads.qc @@ -171,10 +171,8 @@ void trigger_push_touch() } 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) diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 4c477c28f..2557d10d1 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -23,9 +23,9 @@ float accuracy_byte(float n, float 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); @@ -79,7 +79,7 @@ void accuracy_resend(entity e) .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; diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index bc7413033..773b7f085 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -13,7 +13,7 @@ .float csqcprojectile_type; -float CSQCProjectile_SendEntity(entity to, float sf) +float CSQCProjectile_SendEntity(entity to, int sf) { float ft, fr; @@ -81,7 +81,7 @@ void CSQCProjectile_Check(entity e) 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); diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index 56bab19a4..5ea0a5d9d 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -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(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. - 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; @@ -139,9 +138,9 @@ float W_GetCycleWeapon(entity pl, string weaponorder, float dir, float imp, floa if(dir == 0) switchtonext = 1; - c = 0; + int c = 0; - rest = weaponorder; + string rest = weaponorder; while(rest != "") { weaponwant = stof(car(rest)); rest = cdr(rest); diff --git a/qcsrc/server/weapons/selection.qh b/qcsrc/server/weapons/selection.qh index 21ca14d95..69f644c70 100644 --- a/qcsrc/server/weapons/selection.qh +++ b/qcsrc/server/weapons/selection.qh @@ -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 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) @@ -30,4 +30,4 @@ void W_PreviousWeapon(float list); // previously used if exists and has ammo, (second) best otherwise void W_LastWeapon(void); -#endif \ No newline at end of file +#endif diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 0cd3d6d82..ea62fcf19 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -23,7 +23,7 @@ string W_Apply_Weaponreplace(string in) { replacement = ""; s = argv(i); - + 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; - float f; + int f; if(self.classname != "droppedweapon" && self.classname != "replacedweapon") { diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index f187b838b..3085af120 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -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 prevend = w_shotend; + //vector prevend = w_shotend; 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 - + dir = W_CalculateSpread(dir, spread, g_weaponspreadfactor, autocvar_g_projectiles_spread_style); - + #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; } -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; diff --git a/qcsrc/server/weapons/tracing.qh b/qcsrc/server/weapons/tracing.qh index 74662d195..1cab448cb 100644 --- a/qcsrc/server/weapons/tracing.qh +++ b/qcsrc/server/weapons/tracing.qh @@ -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); -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 diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 1f3403476..ab85389c5 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -281,7 +281,7 @@ vector CL_Weapon_GetShotOrg(float wpn) void CL_Weaponentity_Think() { - float tb; + int tb; self.nextthink = time; if (intermission_running) self.frame = self.anim_idle.x;