From 883f46c5e696c230a4b8a4c9c8bbe41ec05d1879 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sat, 24 Jan 2015 19:26:47 +1100 Subject: [PATCH] Declare ints as ints --- qcsrc/client/Main.qc | 35 ++++++++------- qcsrc/client/View.qc | 9 ++-- qcsrc/client/autocvars.qh | 2 +- qcsrc/client/csqcmodel_hooks.qc | 3 +- qcsrc/client/hook.qc | 5 +-- qcsrc/client/laser.qc | 9 ++-- qcsrc/client/main.qh | 14 +++--- qcsrc/client/mapvoting.qc | 65 ++++++++++++++-------------- qcsrc/client/modeleffects.qc | 9 ++-- qcsrc/client/movetypes.qh | 36 ++++++++-------- qcsrc/client/shownames.qc | 2 +- qcsrc/client/tuba.qc | 10 +++-- qcsrc/common/animdecide.qc | 3 +- qcsrc/common/buffs.qh | 4 +- qcsrc/common/command/generic.qh | 2 +- qcsrc/common/counting.qh | 2 +- qcsrc/common/mapinfo.qc | 25 +++++------ qcsrc/common/notifications.qh | 6 +-- qcsrc/common/weapons/w_arc.qc | 4 +- qcsrc/common/weapons/weapons.qc | 10 ++--- qcsrc/common/weapons/weapons.qh | 68 +++++++++++++++--------------- qcsrc/csqcmodellib/cl_player.qc | 2 +- qcsrc/csqcmodellib/cl_player.qh | 2 +- qcsrc/csqcmodellib/interpolate.qc | 2 +- qcsrc/server/vehicles/bumblebee.qc | 2 +- qcsrc/warpzonelib/client.qc | 7 +-- 26 files changed, 162 insertions(+), 176 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index d6b00ec9f5..2ce4e92d01 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -247,7 +247,7 @@ float SetTeam(entity o, float Team) void Playerchecker_Think() { - float i; + int i; entity e; for(i = 0; i < maxclients; ++i) { @@ -337,7 +337,7 @@ void Ent_RemoveEntCS() } void Ent_ReadEntCS() { - float sf; + int sf; InterpolateOrigin_Undo(); self.classname = "entcs_receiver"; @@ -418,7 +418,7 @@ void Ent_ReadPlayerScore() // RegisterPlayer(o); //playerchecker will do this for us later, if it has not already done so - float sf, lf; + int sf, lf; #if MAX_SCORE <= 8 sf = ReadByte(); lf = ReadByte(); @@ -426,7 +426,7 @@ void Ent_ReadPlayerScore() sf = ReadShort(); lf = ReadShort(); #endif - float p; + int p; for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2) if(sf & p) { @@ -450,7 +450,7 @@ void Ent_ReadTeamScore() self.team = ReadByte(); o = self.owner = GetTeam(self.team, true); // these team numbers can always be trusted - float sf, lf; + int sf, lf; #if MAX_TEAMSCORE <= 8 sf = ReadByte(); lf = ReadByte(); @@ -473,10 +473,9 @@ void Ent_ReadTeamScore() void Ent_ClientData() { - float f; float newspectatee_status; - f = ReadByte(); + int f = ReadByte(); scoreboard_showscores_force = (f & 1); @@ -523,9 +522,9 @@ void Ent_ClientData() void Ent_Nagger() { - float nags, i, j, b, f; + int i, j, b, f; - nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS + int nags = ReadByte(); // NAGS NAGS NAGS NAGS NAGS NAGS NADZ NAGS NAGS NAGS if(!(nags & 4)) { @@ -578,9 +577,9 @@ void Ent_Nagger() void Ent_EliminatedPlayers() { - float sf, i, j, b, f; + int i, j, b, f; - sf = ReadByte(); + int sf = ReadByte(); if(sf & 1) { for(j = 0; j < maxclients; ++j) @@ -607,8 +606,8 @@ void Ent_RandomSeed() void Ent_ReadAccuracy(void) { - float sf, f, w, b; - sf = ReadInt24_t(); + int f, w; + int sf = ReadInt24_t(); if(sf == 0) { for(w = 0; w <= WEP_LAST - WEP_FIRST; ++w) @@ -620,7 +619,7 @@ void Ent_ReadAccuracy(void) { if(sf & f) { - b = ReadByte(); + int b = ReadByte(); if(b == 0) weapon_accuracy[w] = -1; else if(b == 255) @@ -927,7 +926,7 @@ void Fog_Force() void Gamemode_Init(); void Ent_ScoresInfo() { - float i; + int i; self.classname = "ent_client_scores_info"; gametype = ReadInt24_t(); HUD_ModIcons_SetFunc(); @@ -1093,13 +1092,13 @@ void Net_ReadRace() race_speedaward_alltimebest_holder = strzone(ReadString()); break; case RACE_NET_SERVER_RANKINGS: - float pos, prevpos, del; - pos = ReadShort(); + float prevpos, del; + int pos = ReadShort(); prevpos = ReadShort(); del = ReadShort(); // move other rankings out of the way - float i; + int i; if (prevpos) { for (i=prevpos-1;i>pos-1;--i) { grecordtime[i] = grecordtime[i-1]; diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index d3e60207cb..013fd2ee15 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -3,7 +3,7 @@ vector polyline[16]; void Porto_Draw() { vector p, dir, ang, q, nextdir; - float idx, portal_number, portal1_idx; + float portal_number, portal1_idx; if(activeweapon != WEP_PORTO || spectatee_status || gametype == MAPINFO_TYPE_NEXBALL) return; @@ -27,7 +27,7 @@ void Porto_Draw() p = view_origin; polyline[0] = p; - idx = 1; + int idx = 1; portal_number = 0; nextdir = dir; @@ -865,7 +865,7 @@ void UpdateCrosshair() if(autocvar_crosshair_effect_time > 0) { f = (time - wcross_name_changestarttime) / autocvar_crosshair_effect_time; - if (!(f < 1)) + if (f >= 1) { wcross_ring_prev = ((ring_image) ? TRUE : FALSE); } @@ -971,7 +971,8 @@ void CSQC_UpdateView(float w, float h) { entity e; float fov; - float f, i; + float f; + int i; vector vf_size, vf_min; float a; diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index d945eda865..9eccb08999 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -151,7 +151,7 @@ float autocvar_g_balance_damagepush_speedfactor; float autocvar_g_balance_tuba_attenuation; float autocvar_g_balance_tuba_fadetime; float autocvar_g_balance_tuba_volume; -int autocvar_g_balance_tuba_pitchstep; // TODO: figure out if this should be bool or int +int autocvar_g_balance_tuba_pitchstep; float autocvar_g_warmup_limit; bool autocvar_g_waypointsprite_uppercase; float autocvar_g_waypointsprite_alpha; diff --git a/qcsrc/client/csqcmodel_hooks.qc b/qcsrc/client/csqcmodel_hooks.qc index 1231a3de94..81eefe60f9 100644 --- a/qcsrc/client/csqcmodel_hooks.qc +++ b/qcsrc/client/csqcmodel_hooks.qc @@ -488,8 +488,7 @@ void CSQCModel_Effects_PostUpdate(void) .bool snd_looping; void CSQCModel_Effects_Apply(void) { - int eff = self.csqcmodel_effects; - eff &= ~CSQCMODEL_EF_RESPAWNGHOST; + int eff = self.csqcmodel_effects & ~CSQCMODEL_EF_RESPAWNGHOST; self.renderflags &= ~(RF_DEPTHHACK | RF_ADDITIVE | RF_FULLBRIGHT | EF_NOSHADOW | RF_USEAXIS); self.effects = 0; diff --git a/qcsrc/client/hook.qc b/qcsrc/client/hook.qc index 8b2ffca19c..ec8029f00b 100644 --- a/qcsrc/client/hook.qc +++ b/qcsrc/client/hook.qc @@ -190,8 +190,7 @@ void Ent_ReadHook(float bIsNew, float type) { self.HookType = type; - float sf; - sf = ReadByte(); + int sf = ReadByte(); self.HookSilent = (sf & 0x80); self.iflags = IFLAG_VELOCITY | IFLAG_ORIGIN; @@ -200,7 +199,7 @@ void Ent_ReadHook(float bIsNew, float type) if(sf & 1) { - float myowner = ReadByte(); + int myowner = ReadByte(); self.owner = playerslots[myowner - 1]; self.sv_entnum = myowner; switch(self.HookType) diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index f6b3fc4cbe..861011f3b9 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -1,10 +1,10 @@ // a laser goes from origin in direction angles // it has color 'colormod' // and stops when something is in the way -.float cnt; // end effect +.int cnt; // end effect .vector colormod; -.float state; // on-off -.float count; // flags for the laser +.int state; // on-off +.int count; // flags for the laser .vector velocity; .float alpha; .float scale; // scaling factor of the thickness @@ -63,11 +63,10 @@ void Draw_Laser() void Ent_Laser() { - float f; InterpolateOrigin_Undo(); // 30 bytes, or 13 bytes for just moving - f = ReadByte(); + int f = ReadByte(); self.count = (f & 0xF0); if(self.count & 0x80) diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 87163482b2..d69a718b4b 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -61,13 +61,13 @@ const float SP_SEPARATOR = -100; float hud_field[MAX_HUD_FIELDS + 1]; float hud_size[MAX_HUD_FIELDS + 1]; string hud_title[MAX_HUD_FIELDS + 1]; -float hud_num_fields; +int hud_num_fields; string scores_label[MAX_SCORE]; -float scores_flags[MAX_SCORE]; +int scores_flags[MAX_SCORE]; string teamscores_label[MAX_SCORE]; -float teamscores_flags[MAX_SCORE]; -.float scores[MAX_SCORE]; +int teamscores_flags[MAX_SCORE]; +.int scores[MAX_SCORE]; .float teamscores[MAX_TEAMSCORE]; #define IS_INCREASING(x) ( (x)&SFL_LOWER_IS_BETTER ) @@ -131,9 +131,9 @@ const float ALPHA_MIN_VISIBLE = 0.003; float armorblockpercent; //hooks -float calledhooks; -const float HOOK_START = 1; -const float HOOK_END = 2; +int calledhooks; +const int HOOK_START = 1; +const int HOOK_END = 2; .float ping, ping_packetloss, ping_movementloss; diff --git a/qcsrc/client/mapvoting.qc b/qcsrc/client/mapvoting.qc index ac8d475529..dc1b8253b0 100644 --- a/qcsrc/client/mapvoting.qc +++ b/qcsrc/client/mapvoting.qc @@ -1,4 +1,4 @@ -float mv_num_maps; +int mv_num_maps; float mv_active; string mv_maps[MAPVOTE_COUNT]; @@ -17,17 +17,17 @@ float mv_top2_time; float mv_top2_alpha; vector mv_mousepos; -float mv_selection; -float mv_columns; -float mv_mouse_selection; -float mv_selection_keyboard; +int mv_selection; +int mv_columns; +int mv_mouse_selection; +int mv_selection_keyboard; float gametypevote; string mapvote_chosenmap; vector gtv_text_size; vector gtv_text_size_small; -string MapVote_FormatMapItem(float id, string map, float count, float maxwidth, vector fontsize) +string MapVote_FormatMapItem(int id, string map, float count, float maxwidth, vector fontsize) { string pre, post; pre = sprintf("%d. ", id+1); @@ -52,7 +52,7 @@ string GameTypeVote_DescriptionByID(float id) return MapInfo_Type_Description(MapInfo_Type_FromString(mv_maps[id])); } -vector MapVote_RGB(float id) +vector MapVote_RGB(int id) { if(mv_avail[id] != GTV_AVAILABLE) return '1 1 1'; @@ -64,7 +64,7 @@ vector MapVote_RGB(float id) return '1 1 1'; } -void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float count, float id) +void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float count, int id) { float alpha; float desc_padding = gtv_text_size_x * 3; @@ -158,7 +158,7 @@ void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string g remove(title); } -void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, float id) +void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, int id) { vector img_size = '0 0 0'; vector rgb; @@ -213,7 +213,7 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin drawfill(pos, img_size, '1 1 1', 0.1, DRAWFLAG_NORMAL); } -void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, float id) +void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, int id) { vector rgb; float text_size; @@ -231,10 +231,9 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa drawstring(pos, label, hud_fontsize, rgb, 1, DRAWFLAG_NORMAL); } -vector MapVote_GridVec(vector gridspec, float i, float m) +vector MapVote_GridVec(vector gridspec, int i, int m) { - float r; - r = i % m; + int r = i % m; return '1 0 0' * (gridspec_x * r) + @@ -276,7 +275,8 @@ float MapVote_Selection(vector topleft, vector cellsize, float rows, float colum void MapVote_Draw() { string map; - float i, tmp; + int i; + float tmp; vector pos; float isize; float center; @@ -436,7 +436,7 @@ void Cmd_MapVote_MapDownload(float argc) } } -void MapVote_CheckPK3(string pic, string pk3, float id) +void MapVote_CheckPK3(string pic, string pk3, int id) { entity pak; pak = spawn(); @@ -457,7 +457,7 @@ void MapVote_CheckPK3(string pic, string pk3, float id) } } -void MapVote_CheckPic(string pic, string pk3, float id) +void MapVote_CheckPic(string pic, string pk3, int id) { // never try to retrieve a pic for the "don't care" 'map' if(mv_abstain && id == mv_num_maps - 1) @@ -473,10 +473,10 @@ void MapVote_CheckPic(string pic, string pk3, float id) void MapVote_ReadMask() { - float i; + int i; if ( mv_num_maps < 24 ) { - float mask, power; + int mask, power; if(mv_num_maps < 8) mask = ReadByte(); else if(mv_num_maps < 16) @@ -496,10 +496,10 @@ void MapVote_ReadMask() const float NUM_SSDIRS = 4; string ssdirs[NUM_SSDIRS]; -float n_ssdirs; +int n_ssdirs; void MapVote_Init() { - float i, j; + int i, j; string map, pk3, s; precache_sound ("misc/invshot.wav"); @@ -608,9 +608,9 @@ void MapVote_SendChoice(float index) localcmd(strcat("\nimpulse ", ftos(index+1), "\n")); } -float MapVote_MoveLeft(float pos) +int MapVote_MoveLeft(int pos) { - float imp; + int imp; if ( pos < 0 ) imp = mv_num_maps - 1; else @@ -619,9 +619,9 @@ float MapVote_MoveLeft(float pos) imp = MapVote_MoveLeft(imp); return imp; } -float MapVote_MoveRight(float pos) +int MapVote_MoveRight(int pos) { - float imp; + int imp; if ( pos < 0 ) imp = 0; else @@ -630,9 +630,9 @@ float MapVote_MoveRight(float pos) imp = MapVote_MoveRight(imp); return imp; } -float MapVote_MoveUp(float pos) +int MapVote_MoveUp(int pos) { - float imp; + int imp; if ( pos < 0 ) imp = mv_num_maps - 1; else @@ -649,9 +649,9 @@ float MapVote_MoveUp(float pos) imp = MapVote_MoveUp(imp); return imp; } -float MapVote_MoveDown(float pos) +int MapVote_MoveDown(int pos) { - float imp; + int imp; if ( pos < 0 ) imp = 0; else @@ -750,7 +750,7 @@ void MapVote_UpdateMask() void MapVote_UpdateVotes() { - float i; + int i; for(i = 0; i < mv_num_maps; ++i) { if(mv_avail[i] == GTV_AVAILABLE) @@ -769,9 +769,7 @@ void MapVote_UpdateVotes() void Ent_MapVote() { - float sf; - - sf = ReadByte(); + int sf = ReadByte(); if(sf & 1) MapVote_Init(); @@ -785,8 +783,7 @@ void Ent_MapVote() void Net_MapVote_Picture() { - float type; - type = ReadByte(); + int type = ReadByte(); mv_preview[type] = true; mv_pics[type] = strzone(ReadPicture()); } diff --git a/qcsrc/client/modeleffects.qc b/qcsrc/client/modeleffects.qc index 0508a8669a..0f873b7e77 100644 --- a/qcsrc/client/modeleffects.qc +++ b/qcsrc/client/modeleffects.qc @@ -22,16 +22,13 @@ void ModelEffect_Draw() } } -void Ent_ModelEffect(float isNew) +void Ent_ModelEffect(bool isNew) { - float f; - entity e; - self.classname = "modeleffect_spawner"; - f = ReadByte(); + int f = ReadByte(); - e = spawn(); + entity e = spawn(); e.classname = "modeleffect"; e.model = "from network"; e.modelindex = ReadShort(); diff --git a/qcsrc/client/movetypes.qh b/qcsrc/client/movetypes.qh index 46b86159e7..72beb6a4af 100644 --- a/qcsrc/client/movetypes.qh +++ b/qcsrc/client/movetypes.qh @@ -4,7 +4,7 @@ .vector move_angles; .vector move_velocity; .vector move_avelocity; -.float move_flags; +.int move_flags; .float move_watertype; .float move_waterlevel; .void(void) move_touch; @@ -20,21 +20,21 @@ void Movetype_Physics_MatchTicrate(float tr, bool sloppy); void Movetype_Physics_MatchServer(bool sloppy); void Movetype_Physics_NoMatchServer(); -const float MOVETYPE_NONE = 0; -const float MOVETYPE_ANGLENOCLIP = 1; -const float MOVETYPE_ANGLECLIP = 2; -const float MOVETYPE_WALK = 3; -const float MOVETYPE_STEP = 4; -const float MOVETYPE_FLY = 5; -const float MOVETYPE_TOSS = 6; -const float MOVETYPE_PUSH = 7; -const float MOVETYPE_NOCLIP = 8; -const float MOVETYPE_FLYMISSILE = 9; -const float MOVETYPE_BOUNCE = 10; -const float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing -const float MOVETYPE_FOLLOW = 12; -const float MOVETYPE_FAKEPUSH = 13; -const float MOVETYPE_FLY_WORLDONLY = 33; +const int MOVETYPE_NONE = 0; +const int MOVETYPE_ANGLENOCLIP = 1; +const int MOVETYPE_ANGLECLIP = 2; +const int MOVETYPE_WALK = 3; +const int MOVETYPE_STEP = 4; +const int MOVETYPE_FLY = 5; +const int MOVETYPE_TOSS = 6; +const int MOVETYPE_PUSH = 7; +const int MOVETYPE_NOCLIP = 8; +const int MOVETYPE_FLYMISSILE = 9; +const int MOVETYPE_BOUNCE = 10; +const int MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing +const int MOVETYPE_FOLLOW = 12; +const int MOVETYPE_FAKEPUSH = 13; +const int MOVETYPE_FLY_WORLDONLY = 33; -const float FL_ITEM = 256; -const float FL_ONGROUND = 512; +const int FL_ITEM = 256; +const int FL_ONGROUND = 512; diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 4a948ca2e8..8aeb12a046 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -180,7 +180,7 @@ void Draw_ShowNames(entity ent) entity shownames_ent[255]; void Draw_ShowNames_All() { - float i; + int i; for(i = 0; i < maxclients; ++i) { float t; diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index cf8f881a0a..b1eaab3aa0 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -3,13 +3,13 @@ const float TUBA_MAX = 27; const float TUBA_INSTRUMENTS = 3; #define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav") -.float note; // note +.int note; // note .float attenuate; // if set, attenuate it .float cnt; // current volume .float count; // initial volume .float tuba_instrument; -float Tuba_PitchStep; +int Tuba_PitchStep; void tubasound(entity e, float restart) { @@ -117,7 +117,8 @@ void Ent_TubaNote_StopSound() void Ent_TubaNote(float bIsNew) { - float f, n, i, att, upd; + int f, n, i; + float att, upd; f = ReadByte(); upd = 0; @@ -178,7 +179,8 @@ void Ent_TubaNote(float bIsNew) void Tuba_Precache() { - float i, n; + float i; + int n; Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep; if(Tuba_PitchStep) { diff --git a/qcsrc/common/animdecide.qc b/qcsrc/common/animdecide.qc index ca37d2b9ee..a2837343ed 100644 --- a/qcsrc/common/animdecide.qc +++ b/qcsrc/common/animdecide.qc @@ -223,8 +223,7 @@ vector animdecide_getloweranim(entity e) void animdecide_setimplicitstate(entity e, float onground) { - float s; - s = 0; + int s = 0; makevectors(e.angles); vector v; diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index c29dad6ddd..bf8b40d5db 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -2,9 +2,9 @@ entity Buff_Type_first; entity Buff_Type_last; .entity enemy; // internal next pointer -var float BUFF_LAST = 1; +float BUFF_LAST = 1; -.float items; // buff ID +.int items; // buff ID .string netname; // buff name .string message; // human readable name .vector colormod; // buff color diff --git a/qcsrc/common/command/generic.qh b/qcsrc/common/command/generic.qh index a61986a8fb..4f6265d154 100644 --- a/qcsrc/common/command/generic.qh +++ b/qcsrc/common/command/generic.qh @@ -17,6 +17,6 @@ string GetProgramCommandPrefix(void); void GenericCommand_macro_write_aliases(float fh); void Curl_URI_Get_Callback(float id, float status, string data); -float curl_uri_get_pos; +int curl_uri_get_pos; float curl_uri_get_exec[URI_GET_CURL_END - URI_GET_CURL + 1]; string curl_uri_get_cvar[URI_GET_CURL_END - URI_GET_CURL + 1]; diff --git a/qcsrc/common/counting.qh b/qcsrc/common/counting.qh index 0aeabc85e7..4a2007cf19 100644 --- a/qcsrc/common/counting.qh +++ b/qcsrc/common/counting.qh @@ -51,7 +51,7 @@ ZCTX(_("CI_THI^%d seconds")), /* third */ \ ZCTX(_("CI_MUL^%d seconds"))) /* multi */ -string count_ordinal(float interval) +string count_ordinal(int interval) { // This function is designed primarily for the English language, it's impossible // to accomodate all languages unless we do a specific function for each one... diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index ccf02e71d8..0e8402979d 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -138,7 +138,7 @@ float _MapInfo_FilterList_cmp(float i, float j, entity pass) return strcasecmp(a, b); } -float MapInfo_FilterGametype(float pGametype, float pFeatures, float pFlagsRequired, float pFlagsForbidden, float pAbortOnGenerate) +float MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, int pFlagsForbidden, bool pAbortOnGenerate) { float i, j; if (!_MapInfo_filtered_allocated) @@ -434,7 +434,7 @@ string _MapInfo_GetDefault(float t) } } -void _MapInfo_Map_ApplyGametype(string s, float pWantedType, float pThisType, float load_default) +void _MapInfo_Map_ApplyGametype(string s, int pWantedType, int pThisType, int load_default) { string sa; MapInfo_Map_supportedGametypes |= pThisType; @@ -575,7 +575,7 @@ float _MapInfo_GetTeamPlayBool(float t) return FALSE; } -void _MapInfo_Map_ApplyGametypeEx(string s, float pWantedType, float pThisType) +void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType) { string sa, k, v; float p; @@ -873,12 +873,13 @@ float MapInfo_isRedundant(string fn, string t) } // load info about a map by name into the MapInfo_Map_* globals -float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, float pGametypeToSet) +float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int pGametypeToSet) { string fn; string s, t; float fh; - float r, f, n, i, p; + int f, i; + float r, n, p; string acl; acl = MAPINFO_SETTEMP_ACL_USER; @@ -1150,7 +1151,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, flo dprint("Map ", pFilename, " supports no game types, ignored\n"); return 0; } -float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametypeToSet) +float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet) { float r = MapInfo_Get_ByName_NoFallbacks(pFilename, pAllowGenerate, pGametypeToSet); @@ -1231,8 +1232,7 @@ string MapInfo_FixName(string s) float MapInfo_CurrentFeatures() { - float req; - req = 0; + int req = 0; if(!(cvar("g_lms") || cvar("g_instagib") || cvar("g_overkill") || cvar("g_nix") || cvar("g_weaponarena") || !cvar("g_pickup_items") || cvar("g_race") || cvar("g_cts") || cvar("g_nexball"))) req |= MAPINFO_FEATURE_WEAPONS; return req; @@ -1240,9 +1240,8 @@ float MapInfo_CurrentFeatures() float MapInfo_CurrentGametype() { - float prev; entity e; - prev = cvar("gamecfg"); + int prev = cvar("gamecfg"); for(e = MapInfo_Type_first; e; e = e.enemy) if(cvar(e.netname)) if(prev != e.items) @@ -1401,8 +1400,7 @@ void MapInfo_Shutdown() float MapInfo_ForbiddenFlags() { - float f; - f = MAPINFO_FLAG_FORBIDDEN; + int f = MAPINFO_FLAG_FORBIDDEN; #ifndef MENUQC if (!cvar("g_maplist_allow_hidden")) @@ -1417,8 +1415,7 @@ float MapInfo_ForbiddenFlags() float MapInfo_RequiredFlags() { - float f; - f = 0; + int f = 0; if(cvar("g_maplist_allow_frustrating") > 1) f |= MAPINFO_FLAG_FRUSTRATING; diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index fb4dc72308..787c4bc601 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -1298,8 +1298,8 @@ entity msg_choice_notifs[NOTIF_CHOICE_MAX]; .float nent_type; .float nent_id; .string nent_name; -.float nent_stringcount; -.float nent_floatcount; +.int nent_stringcount; +.int nent_floatcount; // MSG_ANNCE entity values .float nent_channel; @@ -1385,7 +1385,7 @@ float notif_global_error; #define MSG_INFO_NOTIF(default,name,strnum,flnum,args,hudargs,icon,normal,gentle) \ NOTIF_ADD_AUTOCVAR(name, default) \ - float name; \ + int name; \ void RegisterNotification_##name() \ { \ SET_FIELD_COUNT(name, NOTIF_FIRST, NOTIF_INFO_COUNT) \ diff --git a/qcsrc/common/weapons/w_arc.qc b/qcsrc/common/weapons/w_arc.qc index a32ce00f15..4c30d6e7f1 100644 --- a/qcsrc/common/weapons/w_arc.qc +++ b/qcsrc/common/weapons/w_arc.qc @@ -1168,13 +1168,13 @@ void Remove_ArcBeam(void) void Ent_ReadArcBeam(float isnew) { - float sf = ReadByte(); + int sf = ReadByte(); entity flash; if(isnew) { // calculate shot origin offset from gun alignment - float gunalign = autocvar_cl_gunalign; + int gunalign = autocvar_cl_gunalign; if(gunalign != 1 && gunalign != 2 && gunalign != 4) gunalign = 3; // default value --gunalign; diff --git a/qcsrc/common/weapons/weapons.qc b/qcsrc/common/weapons/weapons.qc index 4f11fc3ef2..e9a834f78e 100644 --- a/qcsrc/common/weapons/weapons.qc +++ b/qcsrc/common/weapons/weapons.qc @@ -75,7 +75,7 @@ WepSet ReadWepSet() #endif void register_weapon( - float id, + int id, WepSet bit, float(float) func, .float ammotype, @@ -148,7 +148,7 @@ void register_weapons_done() weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i)); weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1)); } -entity get_weaponinfo(float id) +entity get_weaponinfo(int id) { entity w; if(id < WEP_FIRST || id > WEP_LAST) @@ -209,14 +209,14 @@ string W_NumberWeaponOrder(string order) float W_FixWeaponOrder_BuildImpulseList_buf[WEP_MAXCOUNT]; string W_FixWeaponOrder_BuildImpulseList_order; -void W_FixWeaponOrder_BuildImpulseList_swap(float i, float j, entity pass) +void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass) { float h; h = W_FixWeaponOrder_BuildImpulseList_buf[i]; W_FixWeaponOrder_BuildImpulseList_buf[i] = W_FixWeaponOrder_BuildImpulseList_buf[j]; W_FixWeaponOrder_BuildImpulseList_buf[j] = h; } -float W_FixWeaponOrder_BuildImpulseList_cmp(float i, float j, entity pass) +float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass) { entity e1, e2; float d; @@ -233,7 +233,7 @@ float W_FixWeaponOrder_BuildImpulseList_cmp(float i, float j, entity pass) } string W_FixWeaponOrder_BuildImpulseList(string o) { - float i; + int i; W_FixWeaponOrder_BuildImpulseList_order = o; for(i = WEP_FIRST; i <= WEP_LAST; ++i) W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i; diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh index dca226f420..1b0061e667 100644 --- a/qcsrc/common/weapons/weapons.qh +++ b/qcsrc/common/weapons/weapons.qh @@ -2,43 +2,43 @@ #include "calculations.qh" #endif -const float MAX_SHOT_DISTANCE = 32768; +const int MAX_SHOT_DISTANCE = 32768; // weapon pickup ratings for bot logic -const float BOT_PICKUP_RATING_LOW = 2500; -const float BOT_PICKUP_RATING_MID = 5000; -const float BOT_PICKUP_RATING_HIGH = 10000; +const int BOT_PICKUP_RATING_LOW = 2500; +const int BOT_PICKUP_RATING_MID = 5000; +const int BOT_PICKUP_RATING_HIGH = 10000; // weapon flags -const float WEP_TYPE_OTHER = 0x00; // not for damaging people -const float WEP_TYPE_SPLASH = 0x01; // splash damage -const float WEP_TYPE_HITSCAN = 0x02; // hitscan -const float WEP_TYPEMASK = 0x0F; -const float WEP_FLAG_CANCLIMB = 0x10; // can be used for movement -const float WEP_FLAG_NORMAL = 0x20; // in "most weapons" set -const float WEP_FLAG_HIDDEN = 0x40; // hides from menu -const float WEP_FLAG_RELOADABLE = 0x80; // can has reload -const float WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer -const float WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag) +const int WEP_TYPE_OTHER = 0x00; // not for damaging people +const int WEP_TYPE_SPLASH = 0x01; // splash damage +const int WEP_TYPE_HITSCAN = 0x02; // hitscan +const int WEP_TYPEMASK = 0x0F; +const int WEP_FLAG_CANCLIMB = 0x10; // can be used for movement +const int WEP_FLAG_NORMAL = 0x20; // in "most weapons" set +const int WEP_FLAG_HIDDEN = 0x40; // hides from menu +const int WEP_FLAG_RELOADABLE = 0x80; // can has reload +const int WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer +const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag) // weapon requests -const float WR_SETUP = 1; // (SERVER) setup weapon data -const float WR_THINK = 2; // (SERVER) logic to run every frame -const float WR_CHECKAMMO1 = 3; // (SERVER) checks ammo for weapon primary -const float WR_CHECKAMMO2 = 4; // (SERVER) checks ammo for weapon second -const float WR_AIM = 5; // (SERVER) runs bot aiming code for this weapon -const float WR_INIT = 6; // (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties -const float WR_SUICIDEMESSAGE = 7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details) -const float WR_KILLMESSAGE = 8; // (SERVER) notification number for kill message (may inspect w_deathtype for details) -const float WR_RELOAD = 9; // (SERVER) handles reloading for weapon -const float WR_RESETPLAYER = 10; // (SERVER) clears fields that the weapon may use -const float WR_IMPACTEFFECT = 11; // (CLIENT) impact effect for weapon explosion -const float WR_PLAYERDEATH = 12; // (SERVER) called whenever a player dies -const float WR_GONETHINK = 13; // (SERVER) logic to run when weapon is lost -const float WR_CONFIG = 14; // (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) -const float WR_ZOOMRETICLE = 15; // (CLIENT) weapon specific zoom reticle -const float WR_DROP = 16; // (SERVER) the weapon is dropped -const float WR_PICKUP = 17; // (SERVER) a weapon is picked up +const int WR_SETUP = 1; // (SERVER) setup weapon data +const int WR_THINK = 2; // (SERVER) logic to run every frame +const int WR_CHECKAMMO1 = 3; // (SERVER) checks ammo for weapon primary +const int WR_CHECKAMMO2 = 4; // (SERVER) checks ammo for weapon second +const int WR_AIM = 5; // (SERVER) runs bot aiming code for this weapon +const int WR_INIT = 6; // (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties +const int WR_SUICIDEMESSAGE = 7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details) +const int WR_KILLMESSAGE = 8; // (SERVER) notification number for kill message (may inspect w_deathtype for details) +const int WR_RELOAD = 9; // (SERVER) handles reloading for weapon +const int WR_RESETPLAYER = 10; // (SERVER) clears fields that the weapon may use +const int WR_IMPACTEFFECT = 11; // (CLIENT) impact effect for weapon explosion +const int WR_PLAYERDEATH = 12; // (SERVER) called whenever a player dies +const int WR_GONETHINK = 13; // (SERVER) logic to run when weapon is lost +const int WR_CONFIG = 14; // (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) +const int WR_ZOOMRETICLE = 15; // (CLIENT) weapon specific zoom reticle +const int WR_DROP = 16; // (SERVER) the weapon is dropped +const int WR_PICKUP = 17; // (SERVER) a weapon is picked up // variables: string weaponorder_byid; @@ -58,8 +58,8 @@ WepSet ReadWepSet(); // weapon name macros #define WEP_FIRST 1 #define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much. -float WEP_COUNT; -float WEP_LAST; +int WEP_COUNT; +int WEP_LAST; WepSet WEPSET_ALL; WepSet WEPSET_SUPERWEAPONS; @@ -156,7 +156,7 @@ void register_weapons_done(); .WepSet weapons; // A: WEPSET_id // WEPSET_... .float(float) weapon_func; // M: function // w_... ..float ammo_field; // M: ammotype // main ammo field -.float impulse; // M: impulse // weapon impulse +.int impulse; // M: impulse // weapon impulse .float spawnflags; // M: flags // WEPSPAWNFLAG_... combined .float bot_pickupbasevalue; // M: rating // bot weapon priority .vector wpcolor; // M: color // waypointsprite color diff --git a/qcsrc/csqcmodellib/cl_player.qc b/qcsrc/csqcmodellib/cl_player.qc index 19fa6b9bd8..2652bd4bc1 100644 --- a/qcsrc/csqcmodellib/cl_player.qc +++ b/qcsrc/csqcmodellib/cl_player.qc @@ -274,7 +274,7 @@ void CSQCPlayer_SetCamera() if(view) { - var float refdefflags = 0; + int refdefflags = 0; if(view.csqcmodel_teleported) refdefflags |= REFDEFFLAG_TELEPORTED; diff --git a/qcsrc/csqcmodellib/cl_player.qh b/qcsrc/csqcmodellib/cl_player.qh index ee1a6ac4d8..a9f0fd68db 100644 --- a/qcsrc/csqcmodellib/cl_player.qh +++ b/qcsrc/csqcmodellib/cl_player.qh @@ -27,7 +27,7 @@ const float CSQCPLAYERSTATUS_FROMSERVER = 1; const float CSQCPLAYERSTATUS_PREDICTED = 2; // only ever READ these! -.float pmove_flags; +.int pmove_flags; float PMF_JUMP_HELD = 1; float PMF_DUCKED = 4; float PMF_ONGROUND = 8; diff --git a/qcsrc/csqcmodellib/interpolate.qc b/qcsrc/csqcmodellib/interpolate.qc index 994323cfe0..8d3b351c85 100644 --- a/qcsrc/csqcmodellib/interpolate.qc +++ b/qcsrc/csqcmodellib/interpolate.qc @@ -35,7 +35,7 @@ void InterpolateOrigin_Reset() void InterpolateOrigin_Note() { float dt; - float f0; + int f0; dt = time - self.itime2; diff --git a/qcsrc/server/vehicles/bumblebee.qc b/qcsrc/server/vehicles/bumblebee.qc index 88b2cb2a56..2400f80082 100644 --- a/qcsrc/server/vehicles/bumblebee.qc +++ b/qcsrc/server/vehicles/bumblebee.qc @@ -1000,7 +1000,7 @@ void bumble_raygun_draw() void bumble_raygun_read(float bIsNew) { - float sf = ReadByte(); + int sf = ReadByte(); if(sf & BRG_SETUP) { diff --git a/qcsrc/warpzonelib/client.qc b/qcsrc/warpzonelib/client.qc index 9f540bc50a..a1191f8d9f 100644 --- a/qcsrc/warpzonelib/client.qc +++ b/qcsrc/warpzonelib/client.qc @@ -17,8 +17,6 @@ void WarpZone_Fade_PreDraw() void WarpZone_Read(float isnew) { - float f; - warpzone_warpzones_exist = 1; if (!self.enemy) { @@ -27,7 +25,7 @@ void WarpZone_Read(float isnew) } self.classname = "trigger_warpzone"; - f = ReadByte(); + int f = ReadByte(); self.warpzone_isboxy = (f & 1); if(f & 4) { @@ -84,11 +82,10 @@ void WarpZone_Read(float isnew) void WarpZone_Camera_Read(float isnew) { - float f; warpzone_cameras_exist = 1; self.classname = "func_warpzone_camera"; - f = ReadByte(); + int f = ReadByte(); if(f & 4) { self.origin_x = ReadCoord(); -- 2.39.2