From 288a95f54dc6763f03136adfdf22fbf244ce9301 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 25 Jan 2015 14:19:06 +1100 Subject: [PATCH] Declare more ints as ints --- qcsrc/client/Defs.qc | 15 +- qcsrc/client/movetypes.qc | 2 +- qcsrc/client/target_music.qc | 8 +- qcsrc/client/vehicles/vehicles.qc | 5 +- qcsrc/common/constants.qh | 434 +++++++++++++++--------------- qcsrc/common/nades.qc | 2 +- qcsrc/common/notifications.qc | 52 ++-- qcsrc/common/notifications.qh | 28 +- qcsrc/common/stats.qh | 254 ++++++++--------- qcsrc/common/urllib.qc | 4 +- qcsrc/common/util.qc | 39 ++- qcsrc/csqcmodellib/interpolate.qh | 22 +- qcsrc/server/t_items.qc | 2 +- 13 files changed, 432 insertions(+), 435 deletions(-) diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 0be5dc97d..604bfef52 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -116,7 +116,7 @@ void end_sys_globals; // flag for structure dumping .string model; .float frame; .float skin; -.float effects; +.int effects; .vector mins, maxs; // bounding box extents reletive to origin .vector size; // maxs - mins @@ -134,9 +134,9 @@ void end_sys_globals; // flag for structure dumping .entity enemy; -.float flags; +.int flags; -.float colormap; +.int colormap; .entity owner; // who launched a missile @@ -149,7 +149,7 @@ float intermission; float scoreboard_showscores; float scoreboard_showaccuracy; .string message; -.float renderflags; +.int renderflags; // float coop; // float deathmatch; @@ -167,7 +167,7 @@ float dmg_take; // Basic variables .float enttype; // entity type sent from server -.float sv_entnum; // entity number sent from server +.int sv_entnum; // entity number sent from server .float team; .float team_size; @@ -247,7 +247,8 @@ vector angles_held; // weapons .float silent; -float w_deathtype, w_issilent, w_random; +int w_deathtype; +float w_issilent, w_random; vector w_org, w_backoff; float rifle_scope; @@ -264,7 +265,7 @@ string weaponorder_bypriority; float vortex_charge_movingavg; -float serverflags; +int serverflags; float uid2name_dialog; diff --git a/qcsrc/client/movetypes.qc b/qcsrc/client/movetypes.qc index 1c3487aca..a5ffdabfb 100644 --- a/qcsrc/client/movetypes.qc +++ b/qcsrc/client/movetypes.qc @@ -1,4 +1,4 @@ -const float MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4; +const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4; #define GRAVITY_UNAFFECTED_BY_TICRATE (getstati(STAT_MOVEFLAGS) & MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE) .entity move_groundentity; // FIXME add move_groundnetworkentity? diff --git a/qcsrc/client/target_music.qc b/qcsrc/client/target_music.qc index 1d90a664c..731c432af 100644 --- a/qcsrc/client/target_music.qc +++ b/qcsrc/client/target_music.qc @@ -4,7 +4,7 @@ entity music_target; entity music_trigger; // FIXME also control bgmvolume here, to not require a target_music for the default track. -.float state; +.int state; .float lastvol; void TargetMusic_Advance() @@ -138,9 +138,7 @@ void Ent_TriggerMusic_Remove() void Ent_ReadTriggerMusic() { - float f; - string s; - f = ReadByte(); + int f = ReadByte(); if(f & 4) { self.origin_x = ReadCoord(); @@ -170,7 +168,7 @@ void Ent_ReadTriggerMusic() self.volume = ReadByte() / 255.0; self.fade_time = ReadByte() / 16.0; self.fade_rate = ReadByte() / 16.0; - s = self.noise; + string s = self.noise; if(self.noise) strunzone(self.noise); self.noise = strzone(ReadString()); diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc index 989c3fa6c..f5e470ce0 100644 --- a/qcsrc/client/vehicles/vehicles.qc +++ b/qcsrc/client/vehicles/vehicles.qc @@ -116,7 +116,6 @@ void Net_AuXair2(bool bIsNew) void Net_VehicleSetup() { - int i; int hud_id = ReadByte(); // Weapon update? @@ -137,10 +136,10 @@ void Net_VehicleSetup() hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST); // Init auxiliary crosshairs - entity axh; + int i; for(i = 0; i < MAX_AXH; ++i) { - axh = AuxiliaryXhair[i]; + entity axh = AuxiliaryXhair[i]; if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) remove(axh); diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 316d7fb8b..bcc624d05 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -1,133 +1,133 @@ -const float AS_STRING = 1; -const float AS_INT = 2; -const float AS_FLOAT_TRUNCATED = 2; -const float AS_FLOAT = 8; - -const float TE_CSQC_PICTURE = 100; -const float TE_CSQC_RACE = 101; -const float TE_CSQC_VORTEXBEAMPARTICLE = 103; -const float TE_CSQC_ARC = 104; -const float TE_CSQC_TEAMNAGGER = 105; -const float TE_CSQC_PINGPLREPORT = 106; -const float TE_CSQC_TARGET_MUSIC = 107; -const float TE_CSQC_WEAPONCOMPLAIN = 108; -const float TE_CSQC_VORTEX_SCOPE = 109; -const float TE_CSQC_MINELAYER_MAXMINES = 110; -const float TE_CSQC_HAGAR_MAXROCKETS = 111; -const float TE_CSQC_VEHICLESETUP = 112; -const float TE_CSQC_SVNOTICE = 113; -const float TE_CSQC_SHOCKWAVEPARTICLE = 114; - -const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder -const float RACE_NET_CHECKPOINT_CLEAR = 1; -const float RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder -const float RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent -const float RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent -const float RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder -const float RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason -const float RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason -const float RACE_NET_SERVER_RECORD = 8; // server record, sent to client -const float RACE_NET_SPEED_AWARD = 9; // speed award, sent to client -const float RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client -const float RACE_NET_SERVER_RANKINGS = 11; -const float RACE_NET_SERVER_STATUS = 12; -const float RANKINGS_CNT = 15; - -const float ENT_CLIENT = 0; -const float ENT_CLIENT_DEAD = 1; -const float ENT_CLIENT_ENTCS = 2; -const float ENT_CLIENT_SCORES_INFO = 3; -const float ENT_CLIENT_SCORES = 4; -const float ENT_CLIENT_TEAMSCORES = 5; -const float ENT_CLIENT_POINTPARTICLES = 6; -const float ENT_CLIENT_RAINSNOW = 7; -const float ENT_CLIENT_LASER = 8; -const float ENT_CLIENT_NAGGER = 9; // flags [votecalledvote] -const float ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] -const float ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor] -const float ENT_CLIENT_PROJECTILE = 12; -const float ENT_CLIENT_GIBSPLASH = 13; -const float ENT_CLIENT_DAMAGEINFO = 14; -const float ENT_CLIENT_CASING = 15; -const float ENT_CLIENT_INIT = 16; -const float ENT_CLIENT_MAPVOTE = 17; -const float ENT_CLIENT_CLIENTDATA = 18; -const float ENT_CLIENT_RANDOMSEED = 19; -const float ENT_CLIENT_WALL = 20; -const float ENT_CLIENT_SPIDERBOT = 21; -const float ENT_CLIENT_MODELEFFECT = 22; -const float ENT_CLIENT_TUBANOTE = 23; -const float ENT_CLIENT_WARPZONE = 24; -const float ENT_CLIENT_WARPZONE_CAMERA = 25; -const float ENT_CLIENT_TRIGGER_MUSIC = 26; -const float ENT_CLIENT_HOOK = 27; -const float ENT_CLIENT_ARC_BEAM = 29; // WEAPONTODO: fix numbers -const float ENT_CLIENT_ACCURACY = 30; -const float ENT_CLIENT_SHOWNAMES = 31; -const float ENT_CLIENT_WARPZONE_TELEPORTED = 32; -const float ENT_CLIENT_MODEL = 33; -const float ENT_CLIENT_ITEM = 34; -const float ENT_CLIENT_BUMBLE_RAYGUN = 35; -const float ENT_CLIENT_SPAWNPOINT = 36; -const float ENT_CLIENT_SPAWNEVENT = 37; -const float ENT_CLIENT_NOTIFICATION = 38; -const float ENT_CLIENT_ELIMINATEDPLAYERS = 39; -const float ENT_CLIENT_TURRET = 40; -const float ENT_CLIENT_AUXILIARYXHAIR = 50; -const float ENT_CLIENT_VEHICLE = 60; - -const float ENT_CLIENT_HEALING_ORB = 80; - -const float SPRITERULE_DEFAULT = 0; -const float SPRITERULE_TEAMPLAY = 1; - -const float RADARICON_NONE = 0; -const float RADARICON_FLAG = 1; -const float RADARICON_FLAGCARRIER = 1; -const float RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them -const float RADARICON_DANGER = 1; -const float RADARICON_WAYPOINT = 1; -const float RADARICON_HELPME = 1; -const float RADARICON_CONTROLPOINT = 1; -const float RADARICON_GENERATOR = 1; -const float RADARICON_OBJECTIVE = 1; -const float RADARICON_DOMPOINT = 1; -const float RADARICON_POWERUP = 1; -const float RADARICON_TAGGED = 1; +const int AS_STRING = 1; +const int AS_INT = 2; +const int AS_FLOAT_TRUNCATED = 2; +const int AS_FLOAT = 8; + +const int TE_CSQC_PICTURE = 100; +const int TE_CSQC_RACE = 101; +const int TE_CSQC_VORTEXBEAMPARTICLE = 103; +const int TE_CSQC_ARC = 104; +const int TE_CSQC_TEAMNAGGER = 105; +const int TE_CSQC_PINGPLREPORT = 106; +const int TE_CSQC_TARGET_MUSIC = 107; +const int TE_CSQC_WEAPONCOMPLAIN = 108; +const int TE_CSQC_VORTEX_SCOPE = 109; +const int TE_CSQC_MINELAYER_MAXMINES = 110; +const int TE_CSQC_HAGAR_MAXROCKETS = 111; +const int TE_CSQC_VEHICLESETUP = 112; +const int TE_CSQC_SVNOTICE = 113; +const int TE_CSQC_SHOCKWAVEPARTICLE = 114; + +const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder +const int RACE_NET_CHECKPOINT_CLEAR = 1; +const int RACE_NET_CHECKPOINT_NEXT_QUALIFYING = 2; // byte nextcheckpoint, short recordtime, string recordholder +const int RACE_NET_CHECKPOINT_HIT_RACE = 3; // byte checkpoint, short delta, byte lapsdelta, string opponent +const int RACE_NET_CHECKPOINT_HIT_RACE_BY_OPPONENT = 4; // byte checkpoint, short delta, byte lapsdelta, string opponent +const int RACE_NET_CHECKPOINT_NEXT_SPEC_QUALIFYING = 5; // byte nextcheckpoint, float laptime, short recordtime, string recordholder +const int RACE_NET_PENALTY_RACE = 6; // byte penaltytime, string reason +const int RACE_NET_PENALTY_QUALIFYING = 7; // byte penaltytime, string reason +const int RACE_NET_SERVER_RECORD = 8; // server record, sent to client +const int RACE_NET_SPEED_AWARD = 9; // speed award, sent to client +const int RACE_NET_SPEED_AWARD_BEST = 10; // all time best speed award, sent to client +const int RACE_NET_SERVER_RANKINGS = 11; +const int RACE_NET_SERVER_STATUS = 12; +const int RANKINGS_CNT = 15; + +const int ENT_CLIENT = 0; +const int ENT_CLIENT_DEAD = 1; +const int ENT_CLIENT_ENTCS = 2; +const int ENT_CLIENT_SCORES_INFO = 3; +const int ENT_CLIENT_SCORES = 4; +const int ENT_CLIENT_TEAMSCORES = 5; +const int ENT_CLIENT_POINTPARTICLES = 6; +const int ENT_CLIENT_RAINSNOW = 7; +const int ENT_CLIENT_LASER = 8; +const int ENT_CLIENT_NAGGER = 9; // flags [votecalledvote] +const int ENT_CLIENT_WAYPOINT = 10; // flags origin [team displayrule] [spritename] [spritename2] [spritename3] [lifetime maxdistance hideable] +const int ENT_CLIENT_RADARLINK = 11; // flags [startorigin] [endorigin] [startcolor+16*endcolor] +const int ENT_CLIENT_PROJECTILE = 12; +const int ENT_CLIENT_GIBSPLASH = 13; +const int ENT_CLIENT_DAMAGEINFO = 14; +const int ENT_CLIENT_CASING = 15; +const int ENT_CLIENT_INIT = 16; +const int ENT_CLIENT_MAPVOTE = 17; +const int ENT_CLIENT_CLIENTDATA = 18; +const int ENT_CLIENT_RANDOMSEED = 19; +const int ENT_CLIENT_WALL = 20; +const int ENT_CLIENT_SPIDERBOT = 21; +const int ENT_CLIENT_MODELEFFECT = 22; +const int ENT_CLIENT_TUBANOTE = 23; +const int ENT_CLIENT_WARPZONE = 24; +const int ENT_CLIENT_WARPZONE_CAMERA = 25; +const int ENT_CLIENT_TRIGGER_MUSIC = 26; +const int ENT_CLIENT_HOOK = 27; +const int ENT_CLIENT_ARC_BEAM = 29; // WEAPONTODO: fix numbers +const int ENT_CLIENT_ACCURACY = 30; +const int ENT_CLIENT_SHOWNAMES = 31; +const int ENT_CLIENT_WARPZONE_TELEPORTED = 32; +const int ENT_CLIENT_MODEL = 33; +const int ENT_CLIENT_ITEM = 34; +const int ENT_CLIENT_BUMBLE_RAYGUN = 35; +const int ENT_CLIENT_SPAWNPOINT = 36; +const int ENT_CLIENT_SPAWNEVENT = 37; +const int ENT_CLIENT_NOTIFICATION = 38; +const int ENT_CLIENT_ELIMINATEDPLAYERS = 39; +const int ENT_CLIENT_TURRET = 40; +const int ENT_CLIENT_AUXILIARYXHAIR = 50; +const int ENT_CLIENT_VEHICLE = 60; + +const int ENT_CLIENT_HEALING_ORB = 80; + +const int SPRITERULE_DEFAULT = 0; +const int SPRITERULE_TEAMPLAY = 1; + +const int RADARICON_NONE = 0; +const int RADARICON_FLAG = 1; +const int RADARICON_FLAGCARRIER = 1; +const int RADARICON_HERE = 1; // TODO make these 3 and 4, and make images for them +const int RADARICON_DANGER = 1; +const int RADARICON_WAYPOINT = 1; +const int RADARICON_HELPME = 1; +const int RADARICON_CONTROLPOINT = 1; +const int RADARICON_GENERATOR = 1; +const int RADARICON_OBJECTIVE = 1; +const int RADARICON_DOMPOINT = 1; +const int RADARICON_POWERUP = 1; +const int RADARICON_TAGGED = 1; /////////////////////////// // keys pressed -const float KEY_FORWARD = 1; -const float KEY_BACKWARD = 2; -const float KEY_LEFT = 4; -const float KEY_RIGHT = 8; -const float KEY_JUMP = 16; -const float KEY_CROUCH = 32; -const float KEY_ATCK = 64; -const float KEY_ATCK2 = 128; +const int KEY_FORWARD = 1; +const int KEY_BACKWARD = 2; +const int KEY_LEFT = 4; +const int KEY_RIGHT = 8; +const int KEY_JUMP = 16; +const int KEY_CROUCH = 32; +const int KEY_ATCK = 64; +const int KEY_ATCK2 = 128; /////////////////////////// // cvar constants -const float CVAR_SAVE = 1; -const float CVAR_NOTIFY = 2; -const float CVAR_READONLY = 4; +const int CVAR_SAVE = 1; +const int CVAR_NOTIFY = 2; +const int CVAR_READONLY = 4; /////////////////////////// // csqc communication stuff -const float CTF_STATE_ATTACK = 1; -const float CTF_STATE_DEFEND = 2; -const float CTF_STATE_COMMANDER = 3; +const int CTF_STATE_ATTACK = 1; +const int CTF_STATE_DEFEND = 2; +const int CTF_STATE_COMMANDER = 3; -const float HUD_NORMAL = 0; -const float HUD_VEHICLE_FIRST = 10; -const float HUD_SPIDERBOT = 10; -const float HUD_WAKIZASHI = 11; -const float HUD_RAPTOR = 12; -const float HUD_BUMBLEBEE = 13; -const float HUD_BUMBLEBEE_GUN = 14; -const float HUD_VEHICLE_LAST = 14; +const int HUD_NORMAL = 0; +const int HUD_VEHICLE_FIRST = 10; +const int HUD_SPIDERBOT = 10; +const int HUD_WAKIZASHI = 11; +const int HUD_RAPTOR = 12; +const int HUD_BUMBLEBEE = 13; +const int HUD_BUMBLEBEE_GUN = 14; +const int HUD_VEHICLE_LAST = 14; const vector eX = '1 0 0'; const vector eY = '0 1 0'; @@ -135,32 +135,32 @@ const vector eZ = '0 0 1'; // moved that here so the client knows the max. // # of maps, I'll use arrays for them :P -const float MAPVOTE_COUNT = 30; +const int MAPVOTE_COUNT = 30; /** * Lower scores are better (e.g. suicides) */ -const float SFL_LOWER_IS_BETTER = 1; +const int SFL_LOWER_IS_BETTER = 1; /** * Don't show zero values as scores */ -const float SFL_HIDE_ZERO = 2; +const int SFL_HIDE_ZERO = 2; /** * Allow a column to be hidden (do not automatically add it even if it is a sorting key) */ -const float SFL_ALLOW_HIDE = 16; +const int SFL_ALLOW_HIDE = 16; /** * Display as a rank (with st, nd, rd, th suffix) */ -const float SFL_RANK = 32; +const int SFL_RANK = 32; /** * Display as mm:ss.s, value is stored as 10ths of a second (AND 0 is the worst possible value!) */ -const float SFL_TIME = 64; +const int SFL_TIME = 64; // not an extra constant yet #define SFL_ZERO_IS_WORST SFL_TIME @@ -168,9 +168,9 @@ const float SFL_TIME = 64; /** * Scoring priority (NOTE: PRIMARY is used for fraglimit) */ -const float SFL_SORT_PRIO_SECONDARY = 4; -const float SFL_SORT_PRIO_PRIMARY = 8; -const float SFL_SORT_PRIO_MASK = 12; +const int SFL_SORT_PRIO_SECONDARY = 4; +const int SFL_SORT_PRIO_PRIMARY = 8; +const int SFL_SORT_PRIO_MASK = 12; /** * Score indices @@ -178,29 +178,29 @@ const float SFL_SORT_PRIO_MASK = 12; #define MAX_SCORE 10 #define MAX_TEAMSCORE 2 -const float ST_SCORE = 0; -const float SP_KILLS = 0; -const float SP_DEATHS = 1; -const float SP_SUICIDES = 2; -const float SP_SCORE = 3; +const int ST_SCORE = 0; +const int SP_KILLS = 0; +const int SP_DEATHS = 1; +const int SP_SUICIDES = 2; +const int SP_SCORE = 3; // game mode specific indices are not in common/, but in server/scores_rules.qc! -const float CH_INFO = 0; -const float CH_TRIGGER = -3; -const float CH_WEAPON_A = -1; -const float CH_WEAPON_SINGLE = 1; -const float CH_VOICE = -2; -const float CH_BGM_SINGLE = 8; -const float CH_AMBIENT = -9; -const float CH_TRIGGER_SINGLE = 3; -const float CH_SHOTS = -4; -const float CH_SHOTS_SINGLE = 4; -const float CH_WEAPON_B = -1; -const float CH_PAIN = -6; -const float CH_PAIN_SINGLE = 6; -const float CH_PLAYER = -7; -const float CH_PLAYER_SINGLE = 7; -const float CH_TUBA_SINGLE = 5; +const int CH_INFO = 0; +const int CH_TRIGGER = -3; +const int CH_WEAPON_A = -1; +const int CH_WEAPON_SINGLE = 1; +const int CH_VOICE = -2; +const int CH_BGM_SINGLE = 8; +const int CH_AMBIENT = -9; +const int CH_TRIGGER_SINGLE = 3; +const int CH_SHOTS = -4; +const int CH_SHOTS_SINGLE = 4; +const int CH_WEAPON_B = -1; +const int CH_PAIN = -6; +const int CH_PAIN_SINGLE = 6; +const int CH_PLAYER = -7; +const int CH_PLAYER_SINGLE = 7; +const int CH_TUBA_SINGLE = 5; const float ATTEN_NONE = 0; const float ATTEN_MIN = 0.015625; @@ -214,64 +214,64 @@ const float VOL_BASE = 0.7; const float VOL_BASEVOICE = 1.0; // WEAPONTODO: move this into separate/new projectile handling code // this sets sounds and other properties of the projectiles in csqc -const float PROJECTILE_ELECTRO = 1; -const float PROJECTILE_ROCKET = 2; -const float PROJECTILE_TAG = 3; -const float PROJECTILE_CRYLINK = 5; -const float PROJECTILE_ELECTRO_BEAM = 6; -const float PROJECTILE_GRENADE = 7; -const float PROJECTILE_GRENADE_BOUNCING = 8; -const float PROJECTILE_MINE = 9; -const float PROJECTILE_BLASTER = 10; -const float PROJECTILE_HLAC = 11; -const float PROJECTILE_SEEKER = 12; -const float PROJECTILE_FLAC = 13; -const float PROJECTILE_PORTO_RED = 14; -const float PROJECTILE_PORTO_BLUE = 15; -const float PROJECTILE_HOOKBOMB = 16; -const float PROJECTILE_HAGAR = 17; -const float PROJECTILE_HAGAR_BOUNCING = 18; -const float PROJECTILE_CRYLINK_BOUNCING = 20; -const float PROJECTILE_FIREBALL = 21; -const float PROJECTILE_FIREMINE = 22; - -const float PROJECTILE_RAPTORCANNON = 24; -const float PROJECTILE_RAPTORBOMB = 25; -const float PROJECTILE_RAPTORBOMBLET = 26; -const float PROJECTILE_SPIDERROCKET = 27; -const float PROJECTILE_WAKIROCKET = 28; -const float PROJECTILE_WAKICANNON = 29; - -const float PROJECTILE_BUMBLE_GUN = 30; -const float PROJECTILE_BUMBLE_BEAM = 31; - -const float PROJECTILE_MAGE_SPIKE = 32; -const float PROJECTILE_SHAMBLER_LIGHTNING = 33; - -const float PROJECTILE_RPC = 60; - -const float SPECIES_HUMAN = 0; -const float SPECIES_ROBOT_SOLID = 1; -const float SPECIES_ALIEN = 2; -const float SPECIES_ANIMAL = 3; -const float SPECIES_ROBOT_RUSTY = 4; -const float SPECIES_ROBOT_SHINY = 5; -const float SPECIES_RESERVED = 15; - -const float FRAGS_PLAYER = 0; -const float FRAGS_SPECTATOR = -666; -const float FRAGS_LMS_LOSER = -616; -const float FRAGS_PLAYER_NONSOLID = -616; +const int PROJECTILE_ELECTRO = 1; +const int PROJECTILE_ROCKET = 2; +const int PROJECTILE_TAG = 3; +const int PROJECTILE_CRYLINK = 5; +const int PROJECTILE_ELECTRO_BEAM = 6; +const int PROJECTILE_GRENADE = 7; +const int PROJECTILE_GRENADE_BOUNCING = 8; +const int PROJECTILE_MINE = 9; +const int PROJECTILE_BLASTER = 10; +const int PROJECTILE_HLAC = 11; +const int PROJECTILE_SEEKER = 12; +const int PROJECTILE_FLAC = 13; +const int PROJECTILE_PORTO_RED = 14; +const int PROJECTILE_PORTO_BLUE = 15; +const int PROJECTILE_HOOKBOMB = 16; +const int PROJECTILE_HAGAR = 17; +const int PROJECTILE_HAGAR_BOUNCING = 18; +const int PROJECTILE_CRYLINK_BOUNCING = 20; +const int PROJECTILE_FIREBALL = 21; +const int PROJECTILE_FIREMINE = 22; + +const int PROJECTILE_RAPTORCANNON = 24; +const int PROJECTILE_RAPTORBOMB = 25; +const int PROJECTILE_RAPTORBOMBLET = 26; +const int PROJECTILE_SPIDERROCKET = 27; +const int PROJECTILE_WAKIROCKET = 28; +const int PROJECTILE_WAKICANNON = 29; + +const int PROJECTILE_BUMBLE_GUN = 30; +const int PROJECTILE_BUMBLE_BEAM = 31; + +const int PROJECTILE_MAGE_SPIKE = 32; +const int PROJECTILE_SHAMBLER_LIGHTNING = 33; + +const int PROJECTILE_RPC = 60; + +const int SPECIES_HUMAN = 0; +const int SPECIES_ROBOT_SOLID = 1; +const int SPECIES_ALIEN = 2; +const int SPECIES_ANIMAL = 3; +const int SPECIES_ROBOT_RUSTY = 4; +const int SPECIES_ROBOT_SHINY = 5; +const int SPECIES_RESERVED = 15; + +const int FRAGS_PLAYER = 0; +const int FRAGS_SPECTATOR = -666; +const int FRAGS_LMS_LOSER = -616; +const int FRAGS_PLAYER_NONSOLID = -616; // we can use this frags value for both // water levels -const float WATERLEVEL_NONE = 0; -const float WATERLEVEL_WETFEET = 1; -const float WATERLEVEL_SWIMMING = 2; -const float WATERLEVEL_SUBMERGED = 3; -const float SERVERFLAG_ALLOW_FULLBRIGHT = 1; -const float SERVERFLAG_TEAMPLAY = 2; -const float SERVERFLAG_PLAYERSTATS = 4; +const int WATERLEVEL_NONE = 0; +const int WATERLEVEL_WETFEET = 1; +const int WATERLEVEL_SWIMMING = 2; +const int WATERLEVEL_SUBMERGED = 3; +const int SERVERFLAG_ALLOW_FULLBRIGHT = 1; +const int SERVERFLAG_TEAMPLAY = 2; +const int SERVERFLAG_PLAYERSTATS = 4; // FIXME/EXPLAINME: why? vector autocvar_sv_player_maxs = '16 16 45'; @@ -301,22 +301,22 @@ vector autocvar_sv_player_headsize = '24 24 12'; #define PL_HEAD_z autocvar_sv_player_headsize_z // spawnpoint prios -const float SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200; -const float SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100; -const float SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50; -const float SPAWN_PRIO_GOOD_DISTANCE = 10; +const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200; +const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100; +const int SPAWN_PRIO_RACE_PREVIOUS_SPAWN = 50; +const int SPAWN_PRIO_GOOD_DISTANCE = 10; // URI handles -const float URI_GET_DISCARD = 0; -const float URI_GET_IPBAN = 1; -const float URI_GET_IPBAN_END = 16; -const float URI_GET_CURL = 17; -const float URI_GET_CURL_END = 32; -const float URI_GET_UPDATENOTIFICATION = 33; -const float URI_GET_URLLIB = 128; -const float URI_GET_URLLIB_END = 191; +const int URI_GET_DISCARD = 0; +const int URI_GET_IPBAN = 1; +const int URI_GET_IPBAN_END = 16; +const int URI_GET_CURL = 17; +const int URI_GET_CURL_END = 32; +const int URI_GET_UPDATENOTIFICATION = 33; +const int URI_GET_URLLIB = 128; +const int URI_GET_URLLIB_END = 191; // gametype votes -const float GTV_AVAILABLE = 0; +const int GTV_AVAILABLE = 0; // for later use in per-map gametype filtering -const float GTV_FORBIDDEN = 2; +const int GTV_FORBIDDEN = 2; diff --git a/qcsrc/common/nades.qc b/qcsrc/common/nades.qc index 03b15525c..22280c36c 100644 --- a/qcsrc/common/nades.qc +++ b/qcsrc/common/nades.qc @@ -62,7 +62,7 @@ void healer_setup() void ent_healer() { - float sf = ReadByte(); + int sf = ReadByte(); if(sf & TNSF_SETUP) { diff --git a/qcsrc/common/notifications.qc b/qcsrc/common/notifications.qc index a5a2ff445..3e2de3eab 100644 --- a/qcsrc/common/notifications.qc +++ b/qcsrc/common/notifications.qc @@ -3,7 +3,7 @@ // Last updated: August, 2013 // ================================================ -string Get_Notif_TypeName(float net_type) +string Get_Notif_TypeName(int net_type) { switch(net_type) { @@ -18,7 +18,7 @@ string Get_Notif_TypeName(float net_type) return ""; } -entity Get_Notif_Ent(float net_type, float net_name) +entity Get_Notif_Ent(int net_type, int net_name) { switch(net_type) { @@ -224,7 +224,7 @@ void Destroy_Notification_Entity(entity notif) void Destroy_All_Notifications(void) { entity notif; - float i; + int i; #define DESTROY_LOOP(type,count) \ for(i = 1; i <= count; ++i) \ @@ -251,15 +251,15 @@ void Destroy_All_Notifications(void) } string Process_Notif_Line( - float typeid, - float chat, + int typeId, + bool chat, string input, string notiftype, string notifname, string stringtype) { #ifdef CSQC - if(typeid == MSG_INFO) + if(typeId == MSG_INFO) { if((chat && autocvar_notification_allow_chatboxprint) || (autocvar_notification_allow_chatboxprint == 2)) @@ -477,8 +477,8 @@ string Process_Notif_Args( void Create_Notification_Entity( float var_default, float var_cvar, - float typeid, - float nameid, + int typeId, + int nameid, string namestring, float strnum, float flnum, @@ -496,21 +496,21 @@ void Create_Notification_Entity( string normal, string gentle, /* MSG_MULTI */ - float anncename, - float infoname, - float centername, + int anncename, + int infoname, + int centername, /* MSG_CHOICE */ float challow_def, float challow_var, - float chtype, - float optiona, - float optionb) + int chtype, + int optiona, + int optionb) { // ===================== // Global Entity Setup // ===================== entity notif = spawn(); - switch(typeid) + switch(typeId) { case MSG_ANNCE: { @@ -550,7 +550,7 @@ void Create_Notification_Entity( "^1NOTIFICATION WITH IMPROPER TYPE: ", "^7net_type = %d, net_name = %s.\n" ), - typeid, + typeId, namestring )); return; // It's not possible to recover from this one @@ -558,11 +558,11 @@ void Create_Notification_Entity( } notif.nent_default = var_default; notif.nent_enabled = (1 <= var_cvar); - notif.nent_type = typeid; + notif.nent_type = typeId; notif.nent_id = nameid; notif.nent_name = strzone(namestring); - string typestring = Get_Notif_TypeName(typeid); + string typestring = Get_Notif_TypeName(typeId); // Other pre-notif-setup requisites notif_error = FALSE; @@ -570,7 +570,7 @@ void Create_Notification_Entity( // ==================== // Notification Setup // ==================== - switch(typeid) + switch(typeId) { case MSG_ANNCE: { @@ -725,7 +725,7 @@ void Create_Notification_Entity( #define SET_NOTIF_STRING(string,stringname) \ notif.nent_string = strzone(CCR( \ Process_Notif_Line( \ - typeid, \ + typeId, \ (var_cvar > 1), \ string, \ typestring, \ @@ -862,7 +862,7 @@ void Create_Notification_Entity( "^1NOTIFICATION WITH IMPROPER TYPE: ", "^7net_type = %d, net_name = %s.\n" ), - typeid, + typeId, namestring ); notif_error = TRUE; @@ -905,7 +905,7 @@ void Create_Notification_Entity( "^1NOTIFICATION WITH IMPROPER TYPE: ", "^7net_type = %d, net_name = %s.\n" ), - typeid, + typeId, namestring ); notif_error = TRUE; @@ -974,7 +974,7 @@ void Dump_Notifications(float fh, float alsoprint) NOTIF_WRITE(notif_msg) } string notif_msg; - float i; + int i; entity e; // Note: This warning only applies to the notifications.cfg file that is output... @@ -1188,7 +1188,7 @@ void Debug_Notification(string input) string Local_Notification_sprintf( string input, string args, string s1, string s2, string s3, string s4, - float f1, float f2, float f3, float f4) + int f1, float f2, float f3, float f4) { #ifdef NOTIFICATIONS_DEBUG Debug_Notification(sprintf( @@ -1201,7 +1201,7 @@ string Local_Notification_sprintf( #endif string selected; - float sel_num; + int sel_num; for(sel_num = 0; sel_num < NOTIF_MAX_ARGS; ++sel_num) { arg_slot[sel_num] = ""; } string tmp_s; @@ -1318,9 +1318,9 @@ void Local_Notification_HUD_Notify_Push( float f1, float f2, float f3, float f4) { string selected; - float sel_num; arg_slot[0] = ""; arg_slot[1] = ""; + int sel_num; for(sel_num = 0;(hudargs != "");) { selected = car(hudargs); hudargs = cdr(hudargs); diff --git a/qcsrc/common/notifications.qh b/qcsrc/common/notifications.qh index 787c4bc60..e414ef25d 100644 --- a/qcsrc/common/notifications.qh +++ b/qcsrc/common/notifications.qh @@ -4,16 +4,16 @@ // ================================================ // main types/groups of notifications -const float MSG_ANNCE = 1; // "Global" AND "personal" announcer messages -const float MSG_INFO = 2; // "Global" information messages -const float MSG_CENTER = 3; // "Personal" centerprint messages -const float MSG_CENTER_CPID = 4; // Kill centerprint message -const float MSG_MULTI = 5; // Subcall MSG_INFO and/or MSG_CENTER notifications -const float MSG_CHOICE = 6; // Choose which subcall wrapper to activate +const int MSG_ANNCE = 1; // "Global" AND "personal" announcer messages +const int MSG_INFO = 2; // "Global" information messages +const int MSG_CENTER = 3; // "Personal" centerprint messages +const int MSG_CENTER_CPID = 4; // Kill centerprint message +const int MSG_MULTI = 5; // Subcall MSG_INFO and/or MSG_CENTER notifications +const int MSG_CHOICE = 6; // Choose which subcall wrapper to activate // negative confirmations -const float NO_MSG = -12345; // allows various things to know when no information is added -const float NOTIF_ABORT = -1234; // allows Send_Notification to safely abort sending +const int NO_MSG = -12345; // allows various things to know when no information is added +const int NOTIF_ABORT = -1234; // allows Send_Notification to safely abort sending #define EIGHT_VARS_TO_VARARGS_VARLIST \ VARITEM(1, 0, s1) \ @@ -45,7 +45,7 @@ void Destroy_All_Notifications(void); void Create_Notification_Entity( float var_default, float var_cvar, - float typeid, + float typeId, float nameid, string namestring, float strnum, @@ -1352,7 +1352,7 @@ float notif_global_error; /* COMMON ======================== */ \ default, /* var_default */ \ ACVNN(name), /* var_cvar */ \ - MSG_ANNCE, /* typeid */ \ + MSG_ANNCE, /* typeId */ \ name, /* nameid */ \ strtoupper(#name), /* namestring */ \ NO_MSG, /* strnum */ \ @@ -1394,7 +1394,7 @@ float notif_global_error; /* COMMON ======================== */ \ default, /* var_default */ \ ACVNN(name), /* var_cvar */ \ - MSG_INFO, /* typeid */ \ + MSG_INFO, /* typeId */ \ name, /* nameid */ \ strtoupper(#name), /* namestring */ \ strnum, /* strnum */ \ @@ -1438,7 +1438,7 @@ float notif_global_error; /* COMMON ======================== */ \ default, /* var_default */ \ ACVNN(name), /* var_cvar */ \ - MSG_CENTER, /* typeid */ \ + MSG_CENTER, /* typeId */ \ name, /* nameid */ \ strtoupper(#name), /* namestring */ \ strnum, /* strnum */ \ @@ -1480,7 +1480,7 @@ float notif_global_error; /* COMMON ======================== */ \ default, /* var_default */ \ ACVNN(name), /* var_cvar */ \ - MSG_MULTI, /* typeid */ \ + MSG_MULTI, /* typeId */ \ name, /* nameid */ \ strtoupper(#name), /* namestring */ \ NO_MSG, /* strnum */ \ @@ -1525,7 +1525,7 @@ float notif_global_error; /* COMMON ======================== */ \ default, /* var_default */ \ ACVNN(name), /* var_cvar */ \ - MSG_CHOICE, /* typeid */ \ + MSG_CHOICE, /* typeId */ \ name, /* nameid */ \ strtoupper(#name), /* namestring */ \ NO_MSG, /* strnum */ \ diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 295491710..2bf147fd4 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -1,29 +1,29 @@ // Full list of all stat constants, icnluded in a single location for easy reference // 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats -const float MAX_CL_STATS = 256; -const float STAT_HEALTH = 0; +const int MAX_CL_STATS = 256; +const int STAT_HEALTH = 0; // 1 empty? -const float STAT_WEAPON = 2; -const float STAT_AMMO = 3; -const float STAT_ARMOR = 4; -const float STAT_WEAPONFRAME = 5; -const float STAT_SHELLS = 6; -const float STAT_NAILS = 7; -const float STAT_ROCKETS = 8; -const float STAT_CELLS = 9; -const float STAT_ACTIVEWEAPON = 10; -const float STAT_TOTALSECRETS = 11; -const float STAT_TOTALMONSTERS = 12; -const float STAT_SECRETS = 13; -const float STAT_MONSTERS = 14; -const float STAT_ITEMS = 15; -const float STAT_VIEWHEIGHT = 16; +const int STAT_WEAPON = 2; +const int STAT_AMMO = 3; +const int STAT_ARMOR = 4; +const int STAT_WEAPONFRAME = 5; +const int STAT_SHELLS = 6; +const int STAT_NAILS = 7; +const int STAT_ROCKETS = 8; +const int STAT_CELLS = 9; +const int STAT_ACTIVEWEAPON = 10; +const int STAT_TOTALSECRETS = 11; +const int STAT_TOTALMONSTERS = 12; +const int STAT_SECRETS = 13; +const int STAT_MONSTERS = 14; +const int STAT_ITEMS = 15; +const int STAT_VIEWHEIGHT = 16; // 17 empty? // 18 empty? // 19 empty? // 20 empty? -const float STAT_VIEWZOOM = 21; +const int STAT_VIEWZOOM = 21; // 22 empty? // 23 empty? // 24 empty? @@ -34,61 +34,61 @@ const float STAT_VIEWZOOM = 21; // 29 empty? // 30 empty? // 31 empty? -const float STAT_KH_KEYS = 32; -const float STAT_CTF_STATE = 33; +const int STAT_KH_KEYS = 32; +const int STAT_CTF_STATE = 33; // 34 empty? -const float STAT_WEAPONS = 35; -const float STAT_SWITCHWEAPON = 36; -const float STAT_GAMESTARTTIME = 37; -const float STAT_STRENGTH_FINISHED = 38; -const float STAT_INVINCIBLE_FINISHED = 39; +const int STAT_WEAPONS = 35; +const int STAT_SWITCHWEAPON = 36; +const int STAT_GAMESTARTTIME = 37; +const int STAT_STRENGTH_FINISHED = 38; +const int STAT_INVINCIBLE_FINISHED = 39; // 40 empty? -const float STAT_ARC_HEAT = 41; -const float STAT_PRESSED_KEYS = 42; -const float STAT_ALLOW_OLDVORTEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config -const float STAT_FUEL = 44; -const float STAT_NB_METERSTART = 45; -const float STAT_SHOTORG = 46; // compressShotOrigin -const float STAT_LEADLIMIT = 47; -const float STAT_WEAPON_CLIPLOAD = 48; -const float STAT_WEAPON_CLIPSIZE = 49; -const float STAT_VORTEX_CHARGE = 50; -const float STAT_LAST_PICKUP = 51; -const float STAT_HUD = 52; -const float STAT_VORTEX_CHARGEPOOL = 53; -const float STAT_HIT_TIME = 54; -const float STAT_DAMAGE_DEALT_TOTAL = 55; -const float STAT_TYPEHIT_TIME = 56; -const float STAT_LAYED_MINES = 57; -const float STAT_HAGAR_LOAD = 58; -const float STAT_SWITCHINGWEAPON = 59; -const float STAT_SUPERWEAPONS_FINISHED = 60; -const float STAT_VEHICLESTAT_HEALTH = 61; -const float STAT_VEHICLESTAT_SHIELD = 62; -const float STAT_VEHICLESTAT_ENERGY = 63; -const float STAT_VEHICLESTAT_AMMO1 = 64; -const float STAT_VEHICLESTAT_RELOAD1 = 65; -const float STAT_VEHICLESTAT_AMMO2 = 66; -const float STAT_VEHICLESTAT_RELOAD2 = 67; -const float STAT_VEHICLESTAT_W2MODE = 68; -const float STAT_NADE_TIMER = 69; -const float STAT_SECRETS_TOTAL = 70; -const float STAT_SECRETS_FOUND = 71; -const float STAT_RESPAWN_TIME = 72; -const float STAT_ROUNDSTARTTIME = 73; -const float STAT_WEAPONS2 = 74; -const float STAT_WEAPONS3 = 75; -const float STAT_MONSTERS_TOTAL = 76; -const float STAT_MONSTERS_KILLED = 77; -const float STAT_BUFFS = 78; -const float STAT_NADE_BONUS = 79; -const float STAT_NADE_BONUS_TYPE = 80; -const float STAT_NADE_BONUS_SCORE = 81; -const float STAT_HEALING_ORB = 82; -const float STAT_HEALING_ORB_ALPHA = 83; -const float STAT_PLASMA = 84; -const float STAT_OK_AMMO_CHARGE = 85; -const float STAT_OK_AMMO_CHARGEPOOL = 86; +const int STAT_ARC_HEAT = 41; +const int STAT_PRESSED_KEYS = 42; +const int STAT_ALLOW_OLDVORTEXBEAM = 43; // this stat could later contain some other bits of info, like, more server-side particle config +const int STAT_FUEL = 44; +const int STAT_NB_METERSTART = 45; +const int STAT_SHOTORG = 46; // compressShotOrigin +const int STAT_LEADLIMIT = 47; +const int STAT_WEAPON_CLIPLOAD = 48; +const int STAT_WEAPON_CLIPSIZE = 49; +const int STAT_VORTEX_CHARGE = 50; +const int STAT_LAST_PICKUP = 51; +const int STAT_HUD = 52; +const int STAT_VORTEX_CHARGEPOOL = 53; +const int STAT_HIT_TIME = 54; +const int STAT_DAMAGE_DEALT_TOTAL = 55; +const int STAT_TYPEHIT_TIME = 56; +const int STAT_LAYED_MINES = 57; +const int STAT_HAGAR_LOAD = 58; +const int STAT_SWITCHINGWEAPON = 59; +const int STAT_SUPERWEAPONS_FINISHED = 60; +const int STAT_VEHICLESTAT_HEALTH = 61; +const int STAT_VEHICLESTAT_SHIELD = 62; +const int STAT_VEHICLESTAT_ENERGY = 63; +const int STAT_VEHICLESTAT_AMMO1 = 64; +const int STAT_VEHICLESTAT_RELOAD1 = 65; +const int STAT_VEHICLESTAT_AMMO2 = 66; +const int STAT_VEHICLESTAT_RELOAD2 = 67; +const int STAT_VEHICLESTAT_W2MODE = 68; +const int STAT_NADE_TIMER = 69; +const int STAT_SECRETS_TOTAL = 70; +const int STAT_SECRETS_FOUND = 71; +const int STAT_RESPAWN_TIME = 72; +const int STAT_ROUNDSTARTTIME = 73; +const int STAT_WEAPONS2 = 74; +const int STAT_WEAPONS3 = 75; +const int STAT_MONSTERS_TOTAL = 76; +const int STAT_MONSTERS_KILLED = 77; +const int STAT_BUFFS = 78; +const int STAT_NADE_BONUS = 79; +const int STAT_NADE_BONUS_TYPE = 80; +const int STAT_NADE_BONUS_SCORE = 81; +const int STAT_HEALING_ORB = 82; +const int STAT_HEALING_ORB_ALPHA = 83; +const int STAT_PLASMA = 84; +const int STAT_OK_AMMO_CHARGE = 85; +const int STAT_OK_AMMO_CHARGEPOOL = 86; // 87 empty? // 88 empty? // 89 empty? @@ -108,36 +108,36 @@ const float STAT_OK_AMMO_CHARGEPOOL = 86; // IDs 100 to 104 reserved for gamemodes // freeze tag, clan arena, jailbreak -const float STAT_REDALIVE = 100; -const float STAT_BLUEALIVE = 101; -const float STAT_YELLOWALIVE = 102; -const float STAT_PINKALIVE = 103; +const int STAT_REDALIVE = 100; +const int STAT_BLUEALIVE = 101; +const int STAT_YELLOWALIVE = 102; +const int STAT_PINKALIVE = 103; // domination -const float STAT_DOM_TOTAL_PPS = 100; -const float STAT_DOM_PPS_RED = 101; -const float STAT_DOM_PPS_BLUE = 102; -const float STAT_DOM_PPS_YELLOW = 103; -const float STAT_DOM_PPS_PINK = 104; +const int STAT_DOM_TOTAL_PPS = 100; +const int STAT_DOM_PPS_RED = 101; +const int STAT_DOM_PPS_BLUE = 102; +const int STAT_DOM_PPS_YELLOW = 103; +const int STAT_DOM_PPS_PINK = 104; // vip -const float STAT_VIP = 100; -const float STAT_VIP_RED = 101; -const float STAT_VIP_BLUE = 102; -const float STAT_VIP_YELLOW = 103; -const float STAT_VIP_PINK = 104; +const int STAT_VIP = 100; +const int STAT_VIP_RED = 101; +const int STAT_VIP_BLUE = 102; +const int STAT_VIP_YELLOW = 103; +const int STAT_VIP_PINK = 104; // key hunt -const float STAT_KH_REDKEY_TEAM = 100; -const float STAT_KH_BLUEKEY_TEAM = 101; -const float STAT_KH_YELLOWKEY_TEAM = 102; -const float STAT_KH_PINKKEY_TEAM = 103; +const int STAT_KH_REDKEY_TEAM = 100; +const int STAT_KH_BLUEKEY_TEAM = 101; +const int STAT_KH_YELLOWKEY_TEAM = 102; +const int STAT_KH_PINKKEY_TEAM = 103; /* Gamemode-specific stats end here */ -const float STAT_FROZEN = 105; -const float STAT_REVIVE_PROGRESS = 106; +const int STAT_FROZEN = 105; +const int STAT_REVIVE_PROGRESS = 106; // 107 empty? // 108 empty? // 109 empty? @@ -252,39 +252,39 @@ const float STAT_REVIVE_PROGRESS = 106; // 217 empty? // 218 empty? // 219 empty? -const float STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR = 220; -const float STAT_MOVEVARS_AIRCONTROL_PENALTY = 221; -const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222; -const float STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223; -const float STAT_MOVEVARS_AIRCONTROL_POWER = 224; -const float STAT_MOVEFLAGS = 225; -const float STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL = 226; -const float STAT_MOVEVARS_WARSOWBUNNY_ACCEL = 227; -const float STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED = 228; -const float STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL = 229; -const float STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO = 230; -const float STAT_MOVEVARS_AIRSTOPACCELERATE = 231; -const float STAT_MOVEVARS_AIRSTRAFEACCELERATE = 232; -const float STAT_MOVEVARS_MAXAIRSTRAFESPEED = 233; -const float STAT_MOVEVARS_AIRCONTROL = 234; -const float STAT_FRAGLIMIT = 235; -const float STAT_TIMELIMIT = 236; -const float STAT_MOVEVARS_WALLFRICTION = 237; -const float STAT_MOVEVARS_FRICTION = 238; -const float STAT_MOVEVARS_WATERFRICTION = 239; -const float STAT_MOVEVARS_TICRATE = 240; -const float STAT_MOVEVARS_TIMESCALE = 241; -const float STAT_MOVEVARS_GRAVITY = 242; -const float STAT_MOVEVARS_STOPSPEED = 243; -const float STAT_MOVEVARS_MAXSPEED = 244; -const float STAT_MOVEVARS_SPECTATORMAXSPEED = 245; -const float STAT_MOVEVARS_ACCELERATE = 246; -const float STAT_MOVEVARS_AIRACCELERATE = 247; -const float STAT_MOVEVARS_WATERACCELERATE = 248; -const float STAT_MOVEVARS_ENTGRAVITY = 249; -const float STAT_MOVEVARS_JUMPVELOCITY = 250; -const float STAT_MOVEVARS_EDGEFRICTION = 251; -const float STAT_MOVEVARS_MAXAIRSPEED = 252; -const float STAT_MOVEVARS_STEPHEIGHT = 253; -const float STAT_MOVEVARS_AIRACCEL_QW = 254; -const float STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION = 255; +const int STAT_MOVEVARS_AIRACCEL_QW_STRETCHFACTOR = 220; +const int STAT_MOVEVARS_AIRCONTROL_PENALTY = 221; +const int STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222; +const int STAT_MOVEVARS_AIRSTRAFEACCEL_QW = 223; +const int STAT_MOVEVARS_AIRCONTROL_POWER = 224; +const int STAT_MOVEFLAGS = 225; +const int STAT_MOVEVARS_WARSOWBUNNY_AIRFORWARDACCEL = 226; +const int STAT_MOVEVARS_WARSOWBUNNY_ACCEL = 227; +const int STAT_MOVEVARS_WARSOWBUNNY_TOPSPEED = 228; +const int STAT_MOVEVARS_WARSOWBUNNY_TURNACCEL = 229; +const int STAT_MOVEVARS_WARSOWBUNNY_BACKTOSIDERATIO = 230; +const int STAT_MOVEVARS_AIRSTOPACCELERATE = 231; +const int STAT_MOVEVARS_AIRSTRAFEACCELERATE = 232; +const int STAT_MOVEVARS_MAXAIRSTRAFESPEED = 233; +const int STAT_MOVEVARS_AIRCONTROL = 234; +const int STAT_FRAGLIMIT = 235; +const int STAT_TIMELIMIT = 236; +const int STAT_MOVEVARS_WALLFRICTION = 237; +const int STAT_MOVEVARS_FRICTION = 238; +const int STAT_MOVEVARS_WATERFRICTION = 239; +const int STAT_MOVEVARS_TICRATE = 240; +const int STAT_MOVEVARS_TIMESCALE = 241; +const int STAT_MOVEVARS_GRAVITY = 242; +const int STAT_MOVEVARS_STOPSPEED = 243; +const int STAT_MOVEVARS_MAXSPEED = 244; +const int STAT_MOVEVARS_SPECTATORMAXSPEED = 245; +const int STAT_MOVEVARS_ACCELERATE = 246; +const int STAT_MOVEVARS_AIRACCELERATE = 247; +const int STAT_MOVEVARS_WATERACCELERATE = 248; +const int STAT_MOVEVARS_ENTGRAVITY = 249; +const int STAT_MOVEVARS_JUMPVELOCITY = 250; +const int STAT_MOVEVARS_EDGEFRICTION = 251; +const int STAT_MOVEVARS_MAXAIRSPEED = 252; +const int STAT_MOVEVARS_STEPHEIGHT = 253; +const int STAT_MOVEVARS_AIRACCEL_QW = 254; +const int STAT_MOVEVARS_AIRACCEL_SIDEWAYS_FRICTION = 255; diff --git a/qcsrc/common/urllib.qc b/qcsrc/common/urllib.qc index 3349d5b24..518b207fc 100644 --- a/qcsrc/common/urllib.qc +++ b/qcsrc/common/urllib.qc @@ -85,7 +85,7 @@ float url_URI_Get_Callback(float id, float status, string data) void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass) { entity e; - float i; + int i; if(strstrofs(url, "://", 0) >= 0) { switch(mode) @@ -209,7 +209,7 @@ void url_single_fopen(string url, float mode, url_ready_func rdy, entity pass) // close a file void url_fclose(entity e) { - float i; + int i; if(e.url_fh == URL_FH_CURL) { diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index e972b1d6b..e5eadc452 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -446,7 +446,7 @@ string mmssss(float hundredths) return strcat(ftos(minutes), ":", substring(s, 1, 2), ".", substring(s, 3, 2)); } -string ScoreString(float pFlags, float pValue) +string ScoreString(int pFlags, float pValue) { string valstr; float l; @@ -505,7 +505,7 @@ float lengthLogTable[128]; float invertLengthLog(float x) { - float l, r, m, lerr, rerr; + int l, r, m; if(x >= lengthLogTable[127]) return 127; @@ -525,22 +525,21 @@ float invertLengthLog(float x) } // now: r is >=, l is < - lerr = (x - lengthLogTable[l]); - rerr = (lengthLogTable[r] - x); + float lerr = (x - lengthLogTable[l]); + float rerr = (lengthLogTable[r] - x); if(lerr < rerr) return l; return r; } -vector decompressShortVector(float data) +vector decompressShortVector(int data) { vector out; - float p, y, len; if(data == 0) return '0 0 0'; - p = (data & 0xF000) / 0x1000; - y = (data & 0x0F80) / 0x80; - len = (data & 0x007F); + float p = (data & 0xF000) / 0x1000; + float y = (data & 0x0F80) / 0x80; + int len = (data & 0x007F); //print("\ndecompress: p ", ftos(p)); print("y ", ftos(y)); print("len ", ftos(len), "\n"); @@ -601,9 +600,9 @@ float compressShortVector(vector vec) void compressShortVector_init() { - float l, f, i; - l = 1; - f = pow(2, 1/8); + float l = 1; + float f = pow(2, 1/8); + int i; for(i = 0; i < 128; ++i) { lengthLogTable[i] = l; @@ -1313,17 +1312,17 @@ float textLengthUpToLength(string theText, float maxWidth, textLengthUpToLength_ string find_last_color_code(string s) { - float start, len, i, carets; - start = strstrofs(s, "^", 0); + int start = strstrofs(s, "^", 0); if (start == -1) // no caret found return ""; - len = strlen(s)-1; + int len = strlen(s)-1; + int i; for(i = len; i >= start; --i) { if(substring(s, i, 1) != "^") continue; - carets = 1; + int carets = 1; while (i-carets >= start && substring(s, i-carets, 1) == "^") ++carets; @@ -1742,7 +1741,7 @@ float compressShotOrigin(vector v) } return x * 0x10000 + y * 0x100 + z; } -vector decompressShotOrigin(float f) +vector decompressShotOrigin(int f) { vector v; v_x = ((f & 0xFF0000) / 0x10000) / 2; @@ -2258,7 +2257,7 @@ string CTX(string s) // x-encoding (encoding as zero length invisible string) const string XENCODE_2 = "xX"; const string XENCODE_22 = "0123456789abcdefABCDEF"; -string xencode(float f) +string xencode(int f) { float a, b, c, d; d = f % 22; f = floor(f / 22); @@ -2289,7 +2288,7 @@ float xdecode(string s) return ((a * 22 + b) * 22 + c) * 22 + d; } -float lowestbit(float f) +float lowestbit(int f) { f &= ~(f * 2); f &= ~(f * 4); @@ -2801,7 +2800,7 @@ float Mod_Q1BSP_SuperContentsFromNativeContents(float nativecontents) return 0; } -float Mod_Q1BSP_NativeContentsFromSuperContents(float supercontents) +float Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents) { if(supercontents & (DPCONTENTS_SOLID | DPCONTENTS_BODY)) return CONTENT_SOLID; diff --git a/qcsrc/csqcmodellib/interpolate.qh b/qcsrc/csqcmodellib/interpolate.qh index 535e3dae9..a29fdc46d 100644 --- a/qcsrc/csqcmodellib/interpolate.qh +++ b/qcsrc/csqcmodellib/interpolate.qh @@ -20,17 +20,17 @@ * IN THE SOFTWARE. */ -.float iflags; -const float IFLAG_VELOCITY = 1; -const float IFLAG_ANGLES = 2; -const float IFLAG_AUTOANGLES = 4; -const float IFLAG_VALID = 8; -const float IFLAG_PREVALID = 16; -const float IFLAG_TELEPORTED = 32; -const float IFLAG_AUTOVELOCITY = 64; -const float IFLAG_V_ANGLE = 128; -const float IFLAG_V_ANGLE_X = 256; -const float IFLAG_ORIGIN = 512; +.int iflags; +const int IFLAG_VELOCITY = 1; +const int IFLAG_ANGLES = 2; +const int IFLAG_AUTOANGLES = 4; +const int IFLAG_VALID = 8; +const int IFLAG_PREVALID = 16; +const int IFLAG_TELEPORTED = 32; +const int IFLAG_AUTOVELOCITY = 64; +const int IFLAG_V_ANGLE = 128; +const int IFLAG_V_ANGLE_X = 256; +const int IFLAG_ORIGIN = 512; #define IFLAG_INTERNALMASK (IFLAG_VALID | IFLAG_PREVALID) // call this BEFORE reading an entity update diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 4455d3fb4..7c8f6a319 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -48,7 +48,7 @@ void ItemDrawSimple() void ItemRead(float _IsNew) { - float sf = ReadByte(); + int sf = ReadByte(); if(sf & ISF_LOCATION) { -- 2.39.2