From 95fa7146a0624b304c6f0998ddf2045d826f5822 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 24 Jan 2015 22:01:58 +1100 Subject: [PATCH] Declare more ints as ints --- qcsrc/client/hud.qc | 2 +- qcsrc/client/hud.qh | 32 +++++++++++++++---------------- qcsrc/client/teamradar.qc | 5 ++--- qcsrc/client/teamradar.qh | 2 +- qcsrc/client/waypointsprites.qc | 4 ++-- qcsrc/common/mapinfo.qh | 30 ++++++++++++++--------------- qcsrc/common/monsters/monsters.qc | 4 ++-- 7 files changed, 39 insertions(+), 40 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 9e240048f..308665dc4 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4476,7 +4476,7 @@ void HUD_Reset (void) void HUD_Main (void) { - float i; + int i; // global hud theAlpha fade if(menu_enabled == 1) hud_fade_alpha = 1; diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index eb960a29c..23eed8f1e 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -1,10 +1,10 @@ -const float HUD_PANEL_MAX = 24; +const int HUD_PANEL_MAX = 24; entity hud_panel[HUD_PANEL_MAX]; -const float HUD_PANEL_FIRST = 0; -float HUD_PANEL_NUM; -float HUD_PANEL_LAST; +const int HUD_PANEL_FIRST = 0; +int HUD_PANEL_NUM; +int HUD_PANEL_LAST; -float panel_order[HUD_PANEL_MAX]; +int panel_order[HUD_PANEL_MAX]; string hud_panelorder_prev; float hud_draw_maximized; @@ -21,15 +21,15 @@ float highlightedAction; // 0 = nothing, 1 = move, 2 = resize const float BORDER_MULTIPLIER = 0.25; float scoreboard_bottom; -float weapon_accuracy[WEP_MAXCOUNT]; +int weapon_accuracy[WEP_MAXCOUNT]; float complain_weapon; string complain_weapon_name; float complain_weapon_type; float complain_weapon_time; -float ps_primary, ps_secondary; -float ts_primary, ts_secondary; +int ps_primary, ps_secondary; +int ts_primary, ts_secondary; float last_switchweapon; float last_activeweapon; @@ -43,10 +43,10 @@ float hud_configure_prev; vector hud_configure_gridSize; vector hud_configure_realGridSize; -float hudShiftState; -const float S_SHIFT = 1; -const float S_CTRL = 2; -const float S_ALT = 4; +int hudShiftState; +const int S_SHIFT = 1; +const int S_CTRL = 2; +const int S_ALT = 4; float menu_enabled; // 1 showing the entire HUD, 2 showing only the clicked panel @@ -65,7 +65,7 @@ var vector panel_size_copied; entity panel; .string panel_name; -.float panel_id; +.int panel_id; .vector current_panel_pos; .vector current_panel_size; .string current_panel_bg; @@ -118,7 +118,7 @@ float current_player; HUD_PANEL(BUFFS , HUD_Buffs , buffs) #define HUD_PANEL(NAME,draw_func,name) \ - float HUD_PANEL_##NAME; \ + int HUD_PANEL_##NAME; \ void draw_func(void); \ void RegisterHUD_Panel_##NAME() \ { \ @@ -341,8 +341,8 @@ HUD_Panel_GetBorder() \ const float NOTIFY_MAX_ENTRIES = 10; const float NOTIFY_ICON_MARGIN = 0.02; -float notify_index; -float notify_count; +int notify_index; +int notify_count; float notify_times[NOTIFY_MAX_ENTRIES]; string notify_attackers[NOTIFY_MAX_ENTRIES]; string notify_victims[NOTIFY_MAX_ENTRIES]; diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index c4078a6af..5bb3f45a5 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -144,7 +144,7 @@ void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, } } -void draw_teamradar_link(vector start, vector end, float colors) +void draw_teamradar_link(vector start, vector end, int colors) { vector c0, c1, norm; @@ -202,8 +202,7 @@ void teamradar_loadcvars() void Ent_RadarLink() { - float sendflags; - sendflags = ReadByte(); + int sendflags = ReadByte(); InterpolateOrigin_Undo(); diff --git a/qcsrc/client/teamradar.qh b/qcsrc/client/teamradar.qh index 35ae44385..dfa92ef1c 100644 --- a/qcsrc/client/teamradar.qh +++ b/qcsrc/client/teamradar.qh @@ -3,5 +3,5 @@ const float MAX_TEAMRADAR_TIMES = 32; // to make entities have dots on the team radar .float teamradar_icon; .float teamradar_times[MAX_TEAMRADAR_TIMES]; -.float teamradar_time_index; +.int teamradar_time_index; .vector teamradar_color; diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 2df3dd411..ae6fcffcc 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -31,7 +31,7 @@ float waypointsprite_alpha; .float lifetime; .float fadetime; .float maxdistance; -.float hideflags; +.int hideflags; .float spawntime; .float health; .float build_started; @@ -614,7 +614,7 @@ void Ent_RemoveWaypointSprite() void Ent_WaypointSprite() { - float sendflags, f, t; + int sendflags, f, t; sendflags = ReadByte(); if(!self.spawntime) diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index bbcc267b2..8bd0871e2 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -12,8 +12,8 @@ entity MapInfo_Type_last; .string gametype_description; // game type description #define REGISTER_GAMETYPE(hname,sname,g_name,NAME,gteamplay,defaults,gdescription) \ - var float MAPINFO_TYPE_##NAME; \ - var entity MapInfo_Type##g_name; \ + int MAPINFO_TYPE_##NAME; \ + entity MapInfo_Type##g_name; \ void RegisterGametypes_##g_name() \ { \ MAPINFO_TYPE_##NAME = MAPINFO_TYPE_ALL + 1; \ @@ -82,15 +82,15 @@ REGISTER_GAMETYPE(_("Keepaway"),ka,g_keepaway,KEEPAWAY,TRUE,"timelimit=20 pointl REGISTER_GAMETYPE(_("Invasion"),inv,g_invasion,INVASION,FALSE,"pointlimit=50 teams=0",_("Survive against waves of monsters")); #define g_invasion IS_GAMETYPE(INVASION) -const float MAPINFO_FEATURE_WEAPONS = 1; // not defined for instagib-only maps -const float MAPINFO_FEATURE_VEHICLES = 2; -const float MAPINFO_FEATURE_TURRETS = 4; -const float MAPINFO_FEATURE_MONSTERS = 8; +const int MAPINFO_FEATURE_WEAPONS = 1; // not defined for instagib-only maps +const int MAPINFO_FEATURE_VEHICLES = 2; +const int MAPINFO_FEATURE_TURRETS = 4; +const int MAPINFO_FEATURE_MONSTERS = 8; -const float MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually -const float MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps -const float MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk -const float MAPINFO_FLAG_NOAUTOMAPLIST = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes) +const int MAPINFO_FLAG_HIDDEN = 1; // not in lsmaps/menu/vcall/etc., can just be changed to manually +const int MAPINFO_FLAG_FORBIDDEN = 2; // don't even allow the map by a cvar setting that allows hidden maps +const int MAPINFO_FLAG_FRUSTRATING = 4; // this map is near impossible to play, enable at your own risk +const int MAPINFO_FLAG_NOAUTOMAPLIST = 8; // do not include when automatically building maplist (counts as hidden for maplist building purposes) float MapInfo_count; @@ -102,9 +102,9 @@ string MapInfo_Map_description; string MapInfo_Map_author; string MapInfo_Map_clientstuff; // not in cache, only for map load string MapInfo_Map_fog; // not in cache, only for map load -float MapInfo_Map_supportedGametypes; -float MapInfo_Map_supportedFeatures; -float MapInfo_Map_flags; +int MapInfo_Map_supportedGametypes; +int MapInfo_Map_supportedFeatures; +int MapInfo_Map_flags; vector MapInfo_Map_mins; // these are '0 0 0' if not supported! vector MapInfo_Map_maxs; // these are '0 0 0' if not specified! @@ -115,8 +115,8 @@ void MapInfo_Enumerate(); // filter the info by game type mask (updates MapInfo_count) 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) -float MapInfo_CurrentFeatures(); // retrieves currently required features from cvars -float MapInfo_CurrentGametype(); // retrieves current gametype from cvars +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 diff --git a/qcsrc/common/monsters/monsters.qc b/qcsrc/common/monsters/monsters.qc index 67e176cf2..1b1036f2b 100644 --- a/qcsrc/common/monsters/monsters.qc +++ b/qcsrc/common/monsters/monsters.qc @@ -4,7 +4,7 @@ entity monster_info[MON_MAXCOUNT]; entity dummy_monster_info; -void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname) +void register_monster(int id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname) { entity e; monster_info[id - 1] = e = spawn(); @@ -33,7 +33,7 @@ void register_monsters_done() dummy_monster_info.maxs = '0 0 0'; dummy_monster_info.model = ""; } -entity get_monsterinfo(float id) +entity get_monsterinfo(int id) { entity m; if(id < MON_FIRST || id > MON_LAST) -- 2.39.2