From 5a95a7be13adcf53cc5aedb89ac41c5416fb4304 Mon Sep 17 00:00:00 2001 From: byteManiak Date: Fri, 17 Aug 2018 18:08:23 +0000 Subject: [PATCH] Data types --- qcsrc/client/autocvars.qh | 10 +-- qcsrc/client/defs.qh | 3 +- qcsrc/client/hud/panel/quickmenu.qc | 2 +- qcsrc/client/hud/panel/scoreboard.qh | 2 +- qcsrc/client/main.qc | 10 +-- qcsrc/client/main.qh | 25 +++---- qcsrc/client/mapvoting.qh | 2 +- qcsrc/common/campaign_common.qh | 2 +- qcsrc/common/command/generic.qc | 26 +++---- qcsrc/common/command/generic.qh | 4 +- qcsrc/common/command/rpn.qc | 2 +- qcsrc/common/command/rpn.qh | 2 +- .../gamemode/domination/domination.qc | 12 ++-- .../gamemodes/gamemode/freezetag/freezetag.qc | 18 ++--- qcsrc/common/mapobjects/models.qh | 2 +- qcsrc/common/mapobjects/trigger/jumppads.qh | 2 +- .../mutator/waypoints/waypointsprites.qc | 4 +- .../mutator/waypoints/waypointsprites.qh | 4 +- qcsrc/common/physics/player.qh | 2 +- qcsrc/common/playerstats.qc | 4 +- qcsrc/common/playerstats.qh | 2 +- qcsrc/common/t_items.qc | 2 +- qcsrc/common/t_items.qh | 4 +- qcsrc/common/teams.qh | 12 ++-- qcsrc/server/bot/default/bot.qh | 2 +- qcsrc/server/cheats.qc | 4 +- qcsrc/server/command/banning.qc | 20 +++--- qcsrc/server/command/banning.qh | 2 +- qcsrc/server/command/cmd.qc | 38 +++++----- qcsrc/server/command/common.qc | 30 ++++---- qcsrc/server/command/common.qh | 34 ++++----- qcsrc/server/command/radarmap.qc | 2 +- qcsrc/server/command/radarmap.qh | 4 +- qcsrc/server/command/sv_cmd.qc | 70 +++++++++---------- qcsrc/server/command/vote.qc | 28 ++++---- qcsrc/server/command/vote.qh | 2 +- qcsrc/server/defs.qh | 38 +++++----- qcsrc/server/g_damage.qh | 2 +- qcsrc/server/ipban.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- qcsrc/server/miscfunctions.qh | 22 +++--- qcsrc/server/player.qh | 2 +- qcsrc/server/round_handler.qc | 2 +- qcsrc/server/round_handler.qh | 8 +-- 44 files changed, 236 insertions(+), 236 deletions(-) diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 8eb3ca1dc..9c63f4312 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -39,13 +39,13 @@ float autocvar_cl_effects_lightningarc_drift_end; float autocvar_cl_effects_lightningarc_drift_start; float autocvar_cl_effects_lightningarc_segmentlength; bool autocvar_cl_effects_lightningarc_simple; -int autocvar_cl_gentle; +bool autocvar_cl_gentle; int autocvar_cl_gentle_damage; int autocvar_cl_gentle_gibs; int autocvar_cl_gentle_messages; float autocvar_cl_gibs_damageforcescale = 3.5; float autocvar_cl_gibs_lifetime = 14; -float autocvar_cl_gibs_maxcount = 100; +int autocvar_cl_gibs_maxcount = 100; bool autocvar_cl_gibs_sloppy = 1; float autocvar_cl_gibs_ticrate = 0.1; float autocvar_cl_gibs_velocity_random = 1; @@ -395,12 +395,12 @@ string autocvar_hud_skin; float autocvar_menu_mouse_speed; string autocvar_menu_skin; int autocvar_r_fakelight; -int autocvar_r_fullbright; +bool autocvar_r_fullbright; float autocvar_r_letterbox; string autocvar_scoreboard_columns; bool autocvar_v_flipped; -float autocvar_vid_conheight; -float autocvar_vid_conwidth; +int autocvar_vid_conheight; +int autocvar_vid_conwidth; float autocvar_vid_pixelheight; float autocvar_viewsize; bool autocvar_cl_eventchase_vehicle = 1; diff --git a/qcsrc/client/defs.qh b/qcsrc/client/defs.qh index 9a5335eff..22cbc1a2d 100644 --- a/qcsrc/client/defs.qh +++ b/qcsrc/client/defs.qh @@ -5,7 +5,7 @@ float scoreboard_showscores; float scoreboard_showaccuracy; .string message; -.int renderflags; +.float renderflags; // float coop; // float deathmatch; @@ -16,7 +16,6 @@ float dmg_take; // Darkplaces Render Modifications #if 0 .float alpha; -.float renderflags; .vector colormod; .float scale; #endif diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index 98b15ee95..e7e3c6d65 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -105,7 +105,7 @@ bool QuickMenu_Open(string mode, string submenu, string file) while((s = fgets(fh)) && QuickMenu_Buffer_Size < QUICKMENU_BUFFER_MAXENTRIES) { // first skip invalid entries, so we don't check them anymore - float argc; + int argc; argc = tokenize_console(s); if(argc == 0 || argv(0) == "") continue; diff --git a/qcsrc/client/hud/panel/scoreboard.qh b/qcsrc/client/hud/panel/scoreboard.qh index a560b74c7..b2bda4829 100644 --- a/qcsrc/client/hud/panel/scoreboard.qh +++ b/qcsrc/client/hud/panel/scoreboard.qh @@ -4,7 +4,7 @@ bool scoreboard_active; float scoreboard_fade_alpha; -void Cmd_Scoreboard_SetFields(float argc); +void Cmd_Scoreboard_SetFields(int argc); void Scoreboard_Draw(); void Scoreboard_InitScores(); void Scoreboard_UpdatePlayerTeams(); diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 863905a3d..6844b1e07 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -228,7 +228,7 @@ void Shutdown() } .float has_team; -float SetTeam(entity o, int Team) +bool SetTeam(entity o, int Team) { TC(int, Team); devassert_once(Team); @@ -577,14 +577,14 @@ NET_HANDLE(ENT_CLIENT_NAGGER, bool isnew) { for(j = 0; j < maxclients; ++j) if(playerslots[j]) - playerslots[j].ready = 1; + playerslots[j].ready = true; for(i = 1; i <= maxclients; i += 8) { f = ReadByte(); for(j = i-1, b = BIT(0); b < BIT(8); b <<= 1, ++j) if (!(f & b)) if(playerslots[j]) - playerslots[j].ready = 0; + playerslots[j].ready = false; } } @@ -605,7 +605,7 @@ NET_HANDLE(ENT_CLIENT_ELIMINATEDPLAYERS, bool isnew) if (sf & 1) { for (int j = 0; j < maxclients; ++j) { if (playerslots[j]) { - playerslots[j].eliminated = 1; + playerslots[j].eliminated = true; } } for (int i = 1; i <= maxclients; i += 8) { @@ -615,7 +615,7 @@ NET_HANDLE(ENT_CLIENT_ELIMINATEDPLAYERS, bool isnew) if (f & BIT(b)) continue; int j = i - 1 + b; if (playerslots[j]) { - playerslots[j].eliminated = 0; + playerslots[j].eliminated = false; } } } diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 69c3fa3d2..8a0e78a0d 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -9,7 +9,7 @@ vector mi_scale; // Minimap string minimapname; -float postinit; +bool postinit; entity gametype; float FONT_USER = 8; @@ -27,7 +27,7 @@ void Ent_Remove(entity this); void Gamemode_Init(); -float SetTeam(entity pl, float Team); +bool SetTeam(entity pl, int Team); vector hud_fontsize; @@ -38,10 +38,10 @@ float grecordtime[RANKINGS_CNT]; entity playerslots[255]; // 255 is engine limit on maxclients entity teamslots[17]; // 17 teams (including "spectator team") -.float gotscores; +.bool gotscores; .entity owner; -.float ready; -.float eliminated; +.bool ready; +.bool eliminated; .void(entity) draw; IntrusiveList g_drawables; @@ -64,7 +64,7 @@ bool button_attack2; float current_viewzoom; float zoomin_effect; -float warmup_stage; +bool warmup_stage; void Fog_Force(); @@ -73,15 +73,16 @@ string _getcommandkey(string text, string command, bool forcename); #define getcommandkey_forcename(cmd_name, command) _getcommandkey(cmd_name, command, true) string vote_called_vote; -float ready_waiting; -float ready_waiting_for_me; -float vote_waiting; -float vote_waiting_for_me; +bool ready_waiting; +bool ready_waiting_for_me; +bool vote_waiting; +bool vote_waiting_for_me; float current_zoomfraction; -float cs_project_is_b0rked; -float vid_width, vid_height, vid_pixelheight; +int cs_project_is_b0rked; +int vid_width, vid_height; +float vid_pixelheight; float camera_active; // Demo camera is active if set to true float chase_active_backup; diff --git a/qcsrc/client/mapvoting.qh b/qcsrc/client/mapvoting.qh index 2f95102a9..8a6f542a0 100644 --- a/qcsrc/client/mapvoting.qh +++ b/qcsrc/client/mapvoting.qh @@ -3,7 +3,7 @@ #include void MapVote_Draw(); -void Cmd_MapVote_MapDownload(float argc); +void Cmd_MapVote_MapDownload(int argc); float MapVote_InputEvent(float bInputType, float nPrimary, float nSecondary); diff --git a/qcsrc/common/campaign_common.qh b/qcsrc/common/campaign_common.qh index 3bdc8725c..25c008d26 100644 --- a/qcsrc/common/campaign_common.qh +++ b/qcsrc/common/campaign_common.qh @@ -29,4 +29,4 @@ void CampaignFile_Unload(); // Sets up the campaign for the n-th array item (meaning: campaign_offset+nth // level) using localcmd() -void CampaignSetup(float n); +void CampaignSetup(int n); diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc index 6a05d01f1..08c20072c 100644 --- a/qcsrc/common/command/generic.qc +++ b/qcsrc/common/command/generic.qc @@ -57,7 +57,7 @@ void Curl_URI_Get_Callback(int id, float status, string data) // Command Sub-Functions // ======================= -void GenericCommand_addtolist(float request, float argc) +void GenericCommand_addtolist(int request, int argc) { switch(request) { @@ -97,7 +97,7 @@ void GenericCommand_addtolist(float request, float argc) } } -void GenericCommand_qc_curl(float request, float argc) +void GenericCommand_qc_curl(int request, int argc) { switch(request) { @@ -229,7 +229,7 @@ GENERIC_COMMAND(dumpcommands, "Dump all commands on the program to _cmd } } -void GenericCommand_maplist(float request, float argc) +void GenericCommand_maplist(int request, int argc) { switch(request) { @@ -312,7 +312,7 @@ void GenericCommand_maplist(float request, float argc) } } -void GenericCommand_nextframe(float request, float arguments, string command) +void GenericCommand_nextframe(int request, float arguments, string command) { switch(request) { @@ -332,7 +332,7 @@ void GenericCommand_nextframe(float request, float arguments, string command) } } -void GenericCommand_removefromlist(float request, float argc) +void GenericCommand_removefromlist(int request, int argc) { switch(request) { @@ -367,7 +367,7 @@ void GenericCommand_removefromlist(float request, float argc) } } -void GenericCommand_restartnotifs(float request) +void GenericCommand_restartnotifs(int request) { switch(request) { @@ -415,7 +415,7 @@ void GenericCommand_restartnotifs(float request) } } -void GenericCommand_settemp(float request, float argc) +void GenericCommand_settemp(int request, int argc) { switch(request) { @@ -446,7 +446,7 @@ void GenericCommand_settemp(float request, float argc) } } -void GenericCommand_settemp_restore(float request, float argc) +void GenericCommand_settemp_restore(int request, int argc) { switch(request) { @@ -473,7 +473,7 @@ void GenericCommand_settemp_restore(float request, float argc) } } -void GenericCommand_runtest(float request, float argc) +void GenericCommand_runtest(int request, int argc) { switch(request) { @@ -501,7 +501,7 @@ void GenericCommand_runtest(float request, float argc) /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void GenericCommand_(float request) +void GenericCommand_(int request) { switch(request) { @@ -539,7 +539,7 @@ void GenericCommand_macro_help() FOREACH(GENERIC_COMMANDS, true, LOG_INFOF(" ^2%s^7: %s", it.m_name, it.m_description)); } -float GenericCommand_macro_command(float argc, string command) +float GenericCommand_macro_command(int argc, string command) { string c = strtolower(argv(0)); FOREACH(GENERIC_COMMANDS, it.m_name == c, { @@ -549,7 +549,7 @@ float GenericCommand_macro_command(float argc, string command) return false; } -float GenericCommand_macro_usage(float argc) +float GenericCommand_macro_usage(int argc) { string c = strtolower(argv(1)); FOREACH(GENERIC_COMMANDS, it.m_name == c, { @@ -572,7 +572,7 @@ void GenericCommand_macro_write_aliases(float fh) float GenericCommand(string command) { - float argc = tokenize_console(command); + int argc = tokenize_console(command); float n, j, f, i; string s, s2, c; vector rgb; diff --git a/qcsrc/common/command/generic.qh b/qcsrc/common/command/generic.qh index b39c79901..68aa0ae88 100644 --- a/qcsrc/common/command/generic.qh +++ b/qcsrc/common/command/generic.qh @@ -9,9 +9,9 @@ void GenericCommand_macro_help(); -float GenericCommand_macro_command(float argc, string command); +float GenericCommand_macro_command(int argc, string command); -float GenericCommand_macro_usage(float argc); +float GenericCommand_macro_usage(int argc); void GenericCommand_macro_write_aliases(float fh); diff --git a/qcsrc/common/command/rpn.qc b/qcsrc/common/command/rpn.qc index 7e1c4f52e..0998fad9d 100644 --- a/qcsrc/common/command/rpn.qc +++ b/qcsrc/common/command/rpn.qc @@ -53,7 +53,7 @@ float rpn_popf() { return stof(rpn_pop()); } void rpn_pushf(float f) { return rpn_push(sprintf("%.9g", f)); } void rpn_setf(float f) { return rpn_set(sprintf("%.9g", f)); } -void GenericCommand_rpn(float request, float argc, string command) +void GenericCommand_rpn(int request, int argc, string command) { switch(request) { diff --git a/qcsrc/common/command/rpn.qh b/qcsrc/common/command/rpn.qh index ba028e248..75f5ba65d 100644 --- a/qcsrc/common/command/rpn.qh +++ b/qcsrc/common/command/rpn.qh @@ -11,4 +11,4 @@ int rpn_error; int rpn_sp; string rpn_stack[MAX_RPN_STACK]; -void GenericCommand_rpn(float request, float argc, string command); +void GenericCommand_rpn(int request, int argc, string command); diff --git a/qcsrc/common/gamemodes/gamemode/domination/domination.qc b/qcsrc/common/gamemodes/gamemode/domination/domination.qc index 0cea02f2f..218bb6342 100644 --- a/qcsrc/common/gamemodes/gamemode/domination/domination.qc +++ b/qcsrc/common/gamemodes/gamemode/domination/domination.qc @@ -346,7 +346,7 @@ int Domination_GetWinnerTeam() return -1; // no control points left? } -float Domination_CheckWinner() +bool Domination_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) { @@ -355,7 +355,7 @@ float Domination_CheckWinner() game_stopped = true; round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); - return 1; + return true; } Domination_count_controlpoints(); @@ -363,7 +363,7 @@ float Domination_CheckWinner() float winner_team = Domination_GetWinnerTeam(); if(winner_team == -1) - return 0; + return false; if(winner_team > 0) { @@ -380,12 +380,12 @@ float Domination_CheckWinner() game_stopped = true; round_handler_Init(5, autocvar_g_domination_warmup, autocvar_g_domination_round_timelimit); - return 1; + return true; } -float Domination_CheckPlayers() +bool Domination_CheckPlayers() { - return 1; + return true; } void Domination_RoundStart() diff --git a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc index 15726ada3..013801a4c 100644 --- a/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc +++ b/qcsrc/common/gamemodes/gamemode/freezetag/freezetag.qc @@ -49,7 +49,7 @@ void freezetag_count_alive_players() #define FREEZETAG_ALIVE_TEAMS_OK() (Team_GetNumberOfAliveTeams() == NumTeams(freezetag_teams)) -float freezetag_CheckTeams() +bool freezetag_CheckTeams() { static float prev_missing_teams_mask; if(FREEZETAG_ALIVE_TEAMS_OK()) @@ -57,14 +57,14 @@ float freezetag_CheckTeams() if(prev_missing_teams_mask > 0) Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; - return 1; + return true; } if(total_players == 0) { if(prev_missing_teams_mask > 0) Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_MISSING_TEAMS); prev_missing_teams_mask = -1; - return 0; + return false; } int missing_teams_mask = 0; for (int i = 1; i <= NUM_TEAMS; ++i) @@ -80,7 +80,7 @@ float freezetag_CheckTeams() Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_MISSING_TEAMS, missing_teams_mask); prev_missing_teams_mask = missing_teams_mask; } - return 0; + return false; } int freezetag_getWinnerTeam() @@ -111,7 +111,7 @@ int freezetag_getWinnerTeam() void nades_Clear(entity); void nades_GiveBonus(entity player, float score); -float freezetag_CheckWinner() +bool freezetag_CheckWinner() { if(round_handler_GetEndTime() > 0 && round_handler_GetEndTime() - time <= 0) { @@ -123,12 +123,12 @@ float freezetag_CheckWinner() }); game_stopped = true; round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit); - return 1; + return true; } if (Team_GetNumberOfAliveTeams() > 1) { - return 0; + return false; } int winner_team = freezetag_getWinnerTeam(); @@ -151,7 +151,7 @@ float freezetag_CheckWinner() game_stopped = true; round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit); - return 1; + return true; } entity freezetag_LastPlayerForTeam(entity this) @@ -214,7 +214,7 @@ void freezetag_Freeze(entity targ, entity attacker) freezetag_Add_Score(targ, attacker); } -float freezetag_isEliminated(entity e) +bool freezetag_isEliminated(entity e) { if(IS_PLAYER(e) && (STAT(FROZEN, e) == 1 || IS_DEAD(e))) return true; diff --git a/qcsrc/common/mapobjects/models.qh b/qcsrc/common/mapobjects/models.qh index 50170e251..45346dc8e 100644 --- a/qcsrc/common/mapobjects/models.qh +++ b/qcsrc/common/mapobjects/models.qh @@ -9,7 +9,7 @@ classfield(Wall) .float loddistance1, loddistance2; classfield(Wall) .vector saved; // Needed for interactive clientwalls -.float inactive; // Clientwall disappears when inactive +.bool inactive; // Clientwall disappears when inactive .float alpha_max, alpha_min; // If fade_start > fade_end, fadeout will be inverted // fade_vertical_offset is a vertival offset for player position diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qh b/qcsrc/common/mapobjects/trigger/jumppads.qh index cd6adec31..268134e80 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qh +++ b/qcsrc/common/mapobjects/trigger/jumppads.qh @@ -8,7 +8,7 @@ IntrusiveList g_jumppads; STATIC_INIT(g_jumppads) { g_jumppads = IL_NEW(); } .float pushltime; -.float istypefrag; +.bool istypefrag; .float height; const int NUM_JUMPPADSUSED = 3; diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 6d459acc9..66904d007 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -1103,7 +1103,7 @@ entity WaypointSprite_SpawnFixed( entity WaypointSprite_DeployFixed( entity spr, - float limited_range, + bool limited_range, entity player, vector ofs, entity icon // initial icon @@ -1135,7 +1135,7 @@ entity WaypointSprite_DeployPersonal( entity WaypointSprite_Attach( entity spr, entity player, - float limited_range, + bool limited_range, entity icon // initial icon ) { diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh index 94d735a1f..9bfa4862b 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qh @@ -203,7 +203,7 @@ entity WaypointSprite_SpawnFixed( .entity waypointsprite_deployed_fixed; entity WaypointSprite_DeployFixed( entity spr, - float limited_range, + bool limited_range, entity player, vector ofs, entity icon // initial icon @@ -222,7 +222,7 @@ entity WaypointSprite_DeployPersonal( entity WaypointSprite_Attach( entity spr, entity player, - float limited_range, + bool limited_range, entity icon // initial icon ); diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index da48fa698..478789dc2 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -15,7 +15,7 @@ .float swamp_slowdown; .float lastflags; .float lastground; -.float wasFlying; +.bool wasFlying; .int buttons_old; .vector movement_old; diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index cde6a5190..869af4da9 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -55,7 +55,7 @@ void PlayerStats_GameReport_AddPlayer(entity e) } } -void PlayerStats_GameReport_AddTeam(float t) +void PlayerStats_GameReport_AddTeam(int t) { if(PS_GR_OUT_DB < 0) { return; } @@ -157,7 +157,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p) strfree(p.playerstats_id); } -void PlayerStats_GameReport(float finished) +void PlayerStats_GameReport(bool finished) { if(PS_GR_OUT_DB < 0) { return; } diff --git a/qcsrc/common/playerstats.qh b/qcsrc/common/playerstats.qh index 28f985e27..d27dd0ed1 100644 --- a/qcsrc/common/playerstats.qh +++ b/qcsrc/common/playerstats.qh @@ -54,7 +54,7 @@ const string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood"; const string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim"; // delay map switch until this is set -float PlayerStats_GameReport_DelayMapVote; +bool PlayerStats_GameReport_DelayMapVote; // call at initialization void PlayerStats_GameReport_Init(); diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 71c522926..0d4d2b92a 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -402,7 +402,7 @@ bool have_pickup_item(entity this) return true; } -void Item_Show (entity e, float mode) +void Item_Show (entity e, int mode) { e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST); e.ItemStatus &= ~ITS_STAYWEP; diff --git a/qcsrc/common/t_items.qh b/qcsrc/common/t_items.qh index 9fdb0b092..4d3f45380 100644 --- a/qcsrc/common/t_items.qh +++ b/qcsrc/common/t_items.qh @@ -62,7 +62,7 @@ const float ITEM_RESPAWN_TICKS = 10; .float item_respawncounter; -void Item_Show (entity e, float mode); +void Item_Show (entity e, int mode); void Item_Respawn (entity this); @@ -107,7 +107,7 @@ float weapon_pickupevalfunc(entity player, entity item); float ammo_pickupevalfunc(entity player, entity item); float healtharmor_pickupevalfunc(entity player, entity item); -.float is_item; +.bool is_item; .entity itemdef; void _StartItem(entity this, entity def, float defaultrespawntime, float defaultrespawntimejitter); diff --git a/qcsrc/common/teams.qh b/qcsrc/common/teams.qh index 1a2e1b176..62bb2db7c 100644 --- a/qcsrc/common/teams.qh +++ b/qcsrc/common/teams.qh @@ -56,11 +56,11 @@ const string STATIC_NAME_TEAM_3 = "Yellow"; const string STATIC_NAME_TEAM_4 = "Pink"; #ifdef CSQC -float teamplay; -float myteam; +bool teamplay; +int myteam; #endif -string Team_ColorCode(float teamid) +string Team_ColorCode(int teamid) { switch(teamid) { @@ -73,7 +73,7 @@ string Team_ColorCode(float teamid) return "^7"; } -vector Team_ColorRGB(float teamid) +vector Team_ColorRGB(int teamid) { switch(teamid) { @@ -86,7 +86,7 @@ vector Team_ColorRGB(float teamid) return '0 0 0'; } -string Team_ColorName(float teamid) +string Team_ColorName(int teamid) { switch(teamid) { @@ -100,7 +100,7 @@ string Team_ColorName(float teamid) } // used for replacement in filenames or such where the name CANNOT be allowed to be translated -string Static_Team_ColorName(float teamid) +string Static_Team_ColorName(int teamid) { switch(teamid) { diff --git a/qcsrc/server/bot/default/bot.qh b/qcsrc/server/bot/default/bot.qh index ca567181b..c4da14a4b 100644 --- a/qcsrc/server/bot/default/bot.qh +++ b/qcsrc/server/bot/default/bot.qh @@ -16,7 +16,7 @@ const int AI_STATUS_JETPACK_FLYING = BIT(9); const int AI_STATUS_JETPACK_LANDING = BIT(10); const int AI_STATUS_STUCK = BIT(11); // Cannot reach any goal -.float isbot; // true if this client is actually a bot +.bool isbot; // true if this client is actually a bot .int aistatus; // Skill system diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 04172b5eb..1e3b9e510 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -45,7 +45,7 @@ void Drag_MoveDrag(entity from, entity to) { } #else -.float maycheat; +.bool maycheat; float gamestart_sv_cheats; @@ -59,7 +59,7 @@ void CheatShutdown() { } -float CheatsAllowed(entity this, float i, float argc, float fr) // the cheat gets passed as argument for possible future ACL checking +float CheatsAllowed(entity this, float i, int argc, float fr) // the cheat gets passed as argument for possible future ACL checking { // dead people cannot cheat if(IS_DEAD(this)) diff --git a/qcsrc/server/command/banning.qc b/qcsrc/server/command/banning.qc index da495f796..fb63b057e 100644 --- a/qcsrc/server/command/banning.qc +++ b/qcsrc/server/command/banning.qc @@ -18,7 +18,7 @@ // Last updated: December 29th, 2011 // ===================================================== -void BanCommand_ban(float request, float argc, string command) +void BanCommand_ban(int request, int argc, string command) { switch (request) { @@ -54,7 +54,7 @@ void BanCommand_ban(float request, float argc, string command) } } -void BanCommand_banlist(float request) +void BanCommand_banlist(int request) { switch (request) { @@ -75,7 +75,7 @@ void BanCommand_banlist(float request) } } -void BanCommand_kickban(float request, float argc, string command) +void BanCommand_kickban(int request, int argc, string command) { switch (request) { @@ -122,7 +122,7 @@ void BanCommand_kickban(float request, float argc, string command) } } -void BanCommand_mute(float request, float argc, string command) // TODO: Add a sort of mute-"ban" which allows players to be muted based on IP/cryptokey +void BanCommand_mute(int request, int argc, string command) // TODO: Add a sort of mute-"ban" which allows players to be muted based on IP/cryptokey { switch (request) { @@ -157,7 +157,7 @@ void BanCommand_mute(float request, float argc, string command) // TODO: Add a } } -void BanCommand_unban(float request, float argc) +void BanCommand_unban(int request, int argc) { switch (request) { @@ -203,7 +203,7 @@ void BanCommand_unban(float request, float argc) } } -void BanCommand_unmute(float request, float argc) +void BanCommand_unmute(int request, int argc) { switch (request) { @@ -240,7 +240,7 @@ void BanCommand_unmute(float request, float argc) /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void BanCommand_(float request) +void BanCommand_(int request) { switch(request) { @@ -285,7 +285,7 @@ void BanCommand_macro_help() #undef BAN_COMMAND } -float BanCommand_macro_command(float argc, string command) +float BanCommand_macro_command(int argc, string command) { #define BAN_COMMAND(name, function, description) \ { if (name == strtolower(argv(0))) { function; return true; } } @@ -296,7 +296,7 @@ float BanCommand_macro_command(float argc, string command) return false; } -float BanCommand_macro_usage(float argc) +float BanCommand_macro_usage(int argc) { #define BAN_COMMAND(name, function, description) \ { if (name == strtolower(argv(1))) { function; return true; } } @@ -318,7 +318,7 @@ void BanCommand_macro_write_aliases(float fh) float BanCommand(string command) { - float argc = tokenize_console(command); + int argc = tokenize_console(command); // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 diff --git a/qcsrc/server/command/banning.qh b/qcsrc/server/command/banning.qh index 3cbaaf978..ae16532ec 100644 --- a/qcsrc/server/command/banning.qh +++ b/qcsrc/server/command/banning.qh @@ -12,4 +12,4 @@ void BanCommand_macro_write_aliases(float fh); void BanCommand_macro_help(); -float BanCommand_macro_usage(float argc); +float BanCommand_macro_usage(int argc); diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 04fb79d38..443aac085 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -72,7 +72,7 @@ bool SV_ParseClientCommand_floodcheck(entity this) // Command Sub-Functions // ======================= -void ClientCommand_autoswitch(entity caller, float request, float argc) +void ClientCommand_autoswitch(entity caller, int request, int argc) { switch (request) { @@ -97,7 +97,7 @@ void ClientCommand_autoswitch(entity caller, float request, float argc) } } -void ClientCommand_clientversion(entity caller, float request, float argc) // internal command, used only by code +void ClientCommand_clientversion(entity caller, int request, int argc) // internal command, used only by code { switch (request) { @@ -140,7 +140,7 @@ void ClientCommand_clientversion(entity caller, float request, float argc) // i } } -void ClientCommand_mv_getpicture(entity caller, float request, float argc) // internal command, used only by code +void ClientCommand_mv_getpicture(entity caller, int request, int argc) // internal command, used only by code { switch (request) { @@ -165,7 +165,7 @@ void ClientCommand_mv_getpicture(entity caller, float request, float argc) // i } } -void ClientCommand_join(entity caller, float request) +void ClientCommand_join(entity caller, int request) { switch (request) { @@ -189,7 +189,7 @@ void ClientCommand_join(entity caller, float request) } } -void ClientCommand_physics(entity caller, float request, float argc) +void ClientCommand_physics(entity caller, int request, int argc) { switch (request) { @@ -229,7 +229,7 @@ void ClientCommand_physics(entity caller, float request, float argc) } } -void ClientCommand_ready(entity caller, float request) // todo: anti-spam for toggling readyness +void ClientCommand_ready(entity caller, int request) // todo: anti-spam for toggling readyness { switch (request) { @@ -278,7 +278,7 @@ void ClientCommand_ready(entity caller, float request) // todo: anti-spam for t } } -void ClientCommand_say(entity caller, float request, float argc, string command) +void ClientCommand_say(entity caller, int request, int argc, string command) { switch (request) { @@ -298,7 +298,7 @@ void ClientCommand_say(entity caller, float request, float argc, string command) } } -void ClientCommand_say_team(entity caller, float request, float argc, string command) +void ClientCommand_say_team(entity caller, int request, int argc, string command) { switch (request) { @@ -319,7 +319,7 @@ void ClientCommand_say_team(entity caller, float request, float argc, string com } .bool team_selected; -void ClientCommand_selectteam(entity caller, float request, float argc) +void ClientCommand_selectteam(entity caller, int request, int argc) { switch (request) { @@ -424,7 +424,7 @@ void ClientCommand_selectteam(entity caller, float request, float argc) } } -void ClientCommand_selfstuff(entity caller, float request, string command) +void ClientCommand_selfstuff(entity caller, int request, string command) { switch (request) { @@ -448,7 +448,7 @@ void ClientCommand_selfstuff(entity caller, float request, string command) } } -void ClientCommand_sentcvar(entity caller, float request, float argc, string command) +void ClientCommand_sentcvar(entity caller, int request, int argc, string command) { switch (request) { @@ -482,7 +482,7 @@ void ClientCommand_sentcvar(entity caller, float request, float argc, string com } } -void ClientCommand_spectate(entity caller, float request) +void ClientCommand_spectate(entity caller, int request) { switch (request) { @@ -522,7 +522,7 @@ void ClientCommand_spectate(entity caller, float request) } } -void ClientCommand_suggestmap(entity caller, float request, float argc) +void ClientCommand_suggestmap(entity caller, int request, int argc) { switch (request) { @@ -546,7 +546,7 @@ void ClientCommand_suggestmap(entity caller, float request, float argc) } } -void ClientCommand_tell(entity caller, float request, float argc, string command) +void ClientCommand_tell(entity caller, int request, int argc, string command) { switch (request) { @@ -603,7 +603,7 @@ void ClientCommand_tell(entity caller, float request, float argc, string command } } -void ClientCommand_voice(entity caller, float request, float argc, string command) +void ClientCommand_voice(entity caller, int request, int argc, string command) { switch (request) { @@ -640,7 +640,7 @@ void ClientCommand_voice(entity caller, float request, float argc, string comman /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void ClientCommand_(entity caller, float request) +void ClientCommand_(entity caller, int request) { switch(request) { @@ -695,7 +695,7 @@ void ClientCommand_macro_help(entity caller) #undef CLIENT_COMMAND } -float ClientCommand_macro_command(float argc, entity caller, string command) +float ClientCommand_macro_command(int argc, entity caller, string command) { #define CLIENT_COMMAND(name, function, description) \ { if (name == strtolower(argv(0))) { function; return true; } } @@ -706,7 +706,7 @@ float ClientCommand_macro_command(float argc, entity caller, string command) return false; } -float ClientCommand_macro_usage(float argc, entity caller) +float ClientCommand_macro_usage(int argc, entity caller) { #define CLIENT_COMMAND(name, function, description) \ { if (name == strtolower(argv(1))) { function; return true; } } @@ -744,7 +744,7 @@ void SV_ParseClientCommand(entity this, string command) // if we're banned, don't even parse the command if (Ban_MaybeEnforceBanOnce(this)) return; - float argc = tokenize_console(command); + int argc = tokenize_console(command); // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index eb22080bb..643afa3f1 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -76,7 +76,7 @@ float VerifyClientNumber(float tmp_number) else return true; } -entity GetIndexedEntity(float argc, float start_index) +entity GetIndexedEntity(int argc, float start_index) { entity selection; float tmp_number, index; @@ -280,7 +280,7 @@ void timeout_handler_think(entity this) // Common commands used in both sv_cmd.qc and cmd.qc // =================================================== -void CommonCommand_cvar_changes(float request, entity caller) +void CommonCommand_cvar_changes(int request, entity caller) { switch (request) { @@ -301,7 +301,7 @@ void CommonCommand_cvar_changes(float request, entity caller) } } -void CommonCommand_cvar_purechanges(float request, entity caller) +void CommonCommand_cvar_purechanges(int request, entity caller) { switch (request) { @@ -469,7 +469,7 @@ void CommonCommand_editmob(int request, entity caller, int argc) } } -void CommonCommand_info(float request, entity caller, float argc) +void CommonCommand_info(int request, entity caller, int argc) { switch (request) { @@ -493,7 +493,7 @@ void CommonCommand_info(float request, entity caller, float argc) } } -void CommonCommand_ladder(float request, entity caller) +void CommonCommand_ladder(int request, entity caller) { switch (request) { @@ -513,7 +513,7 @@ void CommonCommand_ladder(float request, entity caller) } } -void CommonCommand_lsmaps(float request, entity caller) +void CommonCommand_lsmaps(int request, entity caller) { switch (request) { @@ -533,7 +533,7 @@ void CommonCommand_lsmaps(float request, entity caller) } } -void CommonCommand_printmaplist(float request, entity caller) +void CommonCommand_printmaplist(int request, entity caller) { switch (request) { @@ -553,7 +553,7 @@ void CommonCommand_printmaplist(float request, entity caller) } } -void CommonCommand_rankings(float request, entity caller) +void CommonCommand_rankings(int request, entity caller) { switch (request) { @@ -573,7 +573,7 @@ void CommonCommand_rankings(float request, entity caller) } } -void CommonCommand_records(float request, entity caller) +void CommonCommand_records(int request, entity caller) { switch (request) { @@ -601,7 +601,7 @@ void CommonCommand_records(float request, entity caller) } } -void CommonCommand_teamstatus(float request, entity caller) +void CommonCommand_teamstatus(int request, entity caller) { switch (request) { @@ -621,7 +621,7 @@ void CommonCommand_teamstatus(float request, entity caller) } } -void CommonCommand_time(float request, entity caller) +void CommonCommand_time(int request, entity caller) { switch (request) { @@ -647,7 +647,7 @@ void CommonCommand_time(float request, entity caller) } } -void CommonCommand_timein(float request, entity caller) +void CommonCommand_timein(int request, entity caller) { switch (request) { @@ -702,7 +702,7 @@ void CommonCommand_timein(float request, entity caller) } } -void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAND IS TERRIBLE. +void CommonCommand_timeout(int request, entity caller) // DEAR GOD THIS COMMAND IS TERRIBLE. { switch (request) { @@ -771,7 +771,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMA } } -void CommonCommand_who(float request, entity caller, float argc) +void CommonCommand_who(int request, entity caller, int argc) { switch (request) { @@ -836,7 +836,7 @@ void CommonCommand_who(float request, entity caller, float argc) /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void CommonCommand_(float request, entity caller) +void CommonCommand_(int request, entity caller) { switch(request) { diff --git a/qcsrc/server/command/common.qh b/qcsrc/server/command/common.qh index 13cbfe49e..f03a815de 100644 --- a/qcsrc/server/command/common.qh +++ b/qcsrc/server/command/common.qh @@ -81,7 +81,7 @@ string GetClientErrorString_color(float clienterror, string original_input, stri // is this entity number even in the possible range of entities? float VerifyClientNumber(float tmp_number); -entity GetIndexedEntity(float argc, float start_index); +entity GetIndexedEntity(int argc, float start_index); // find a player which matches the input string, and return their entity entity GetFilteredEntity(string input); @@ -105,33 +105,33 @@ void timeout_handler_think(entity this); // Common commands used in both sv_cmd.qc and cmd.qc // =================================================== -void CommonCommand_cvar_changes(float request, entity caller); +void CommonCommand_cvar_changes(int request, entity caller); -void CommonCommand_cvar_purechanges(float request, entity caller); +void CommonCommand_cvar_purechanges(int request, entity caller); -void CommonCommand_editmob(float request, entity caller, float argc); +void CommonCommand_editmob(int request, entity caller, int argc); -void CommonCommand_info(float request, entity caller, float argc); +void CommonCommand_info(int request, entity caller, int argc); -void CommonCommand_ladder(float request, entity caller); +void CommonCommand_ladder(int request, entity caller); -void CommonCommand_lsmaps(float request, entity caller); +void CommonCommand_lsmaps(int request, entity caller); -void CommonCommand_printmaplist(float request, entity caller); +void CommonCommand_printmaplist(int request, entity caller); -void CommonCommand_rankings(float request, entity caller); +void CommonCommand_rankings(int request, entity caller); -void CommonCommand_records(float request, entity caller); +void CommonCommand_records(int request, entity caller); -void CommonCommand_teamstatus(float request, entity caller); +void CommonCommand_teamstatus(int request, entity caller); -void CommonCommand_time(float request, entity caller); +void CommonCommand_time(int request, entity caller); -void CommonCommand_timein(float request, entity caller); +void CommonCommand_timein(int request, entity caller); -void CommonCommand_timeout(float request, entity caller); +void CommonCommand_timeout(int request, entity caller); -void CommonCommand_who(float request, entity caller, float argc); +void CommonCommand_who(int request, entity caller, int argc); // ================================== @@ -160,7 +160,7 @@ void CommonCommand_macro_help(entity caller) FOREACH(COMMON_COMMANDS, true, { print_to(caller, sprintf(" ^2%s^7: %s", it.m_name, it.m_description)); }); } -float CommonCommand_macro_command(float argc, entity caller, string command) +float CommonCommand_macro_command(int argc, entity caller, string command) { string c = strtolower(argv(0)); FOREACH(COMMON_COMMANDS, it.m_name == c, { @@ -170,7 +170,7 @@ float CommonCommand_macro_command(float argc, entity caller, string command) return false; } -float CommonCommand_macro_usage(float argc, entity caller) +float CommonCommand_macro_usage(int argc, entity caller) { string c = strtolower(argv(1)); FOREACH(COMMON_COMMANDS, it.m_name == c, { diff --git a/qcsrc/server/command/radarmap.qc b/qcsrc/server/command/radarmap.qc index 87bcef82f..e3dbf795f 100644 --- a/qcsrc/server/command/radarmap.qc +++ b/qcsrc/server/command/radarmap.qc @@ -366,7 +366,7 @@ void RadarMap_Think(entity this) } } -bool RadarMap_Make(float argc) +bool RadarMap_Make(int argc) { float i; diff --git a/qcsrc/server/command/radarmap.qh b/qcsrc/server/command/radarmap.qh index ffa82e5c0..44bd8fb4b 100644 --- a/qcsrc/server/command/radarmap.qh +++ b/qcsrc/server/command/radarmap.qh @@ -1,6 +1,6 @@ #pragma once #ifndef RADARMAP -bool RadarMap_Make(float argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it."); return true; } +bool RadarMap_Make(int argc) { LOG_INFO("radarmap is disabled, compile with -DRADARMAP to enable it."); return true; } #else // =========================================== @@ -17,6 +17,6 @@ string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D // FF is contained twice, to map 256 to FF too // removes the need to bound() -bool RadarMap_Make(float argc); +bool RadarMap_Make(int argc); #endif diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 9ba78c32a..c917874c3 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -88,7 +88,7 @@ void changematchtime(float delta, float mi, float ma) // Command Sub-Functions // ======================= -void GameCommand_adminmsg(float request, float argc) +void GameCommand_adminmsg(int request, int argc) { switch (request) { @@ -160,7 +160,7 @@ void GameCommand_adminmsg(float request, float argc) } } -void GameCommand_allready(float request) +void GameCommand_allready(int request) { switch (request) { @@ -180,7 +180,7 @@ void GameCommand_allready(float request) } } -void GameCommand_allspec(float request, float argc) +void GameCommand_allspec(int request, int argc) { switch (request) { @@ -209,7 +209,7 @@ void GameCommand_allspec(float request, float argc) } } -void GameCommand_anticheat(float request, float argc) +void GameCommand_anticheat(int request, int argc) { switch (request) { @@ -240,7 +240,7 @@ void GameCommand_anticheat(float request, float argc) } } -void GameCommand_bbox(float request) +void GameCommand_bbox(int request) { switch (request) { @@ -313,7 +313,7 @@ void GameCommand_bbox(float request) } } -void GameCommand_bot_cmd(float request, float argc, string command) +void GameCommand_bot_cmd(int request, int argc, string command) { switch (request) { @@ -445,7 +445,7 @@ void GameCommand_bot_cmd(float request, float argc, string command) } } -void GameCommand_cointoss(float request, float argc) +void GameCommand_cointoss(int request, int argc) { switch (request) { @@ -469,7 +469,7 @@ void GameCommand_cointoss(float request, float argc) } } -void GameCommand_database(float request, float argc) +void GameCommand_database(int request, int argc) { switch (request) { @@ -512,7 +512,7 @@ void GameCommand_database(float request, float argc) } } -void GameCommand_defer_clear(float request, float argc) +void GameCommand_defer_clear(int request, int argc) { switch (request) { @@ -549,14 +549,14 @@ void GameCommand_defer_clear(float request, float argc) } } -void GameCommand_defer_clear_all(float request) +void GameCommand_defer_clear_all(int request) { switch (request) { case CMD_REQUEST_COMMAND: { int n = 0; - float argc; + int argc; FOREACH_CLIENT(true, { argc = tokenize_console(strcat("defer_clear ", ftos(etof(it)))); @@ -578,7 +578,7 @@ void GameCommand_defer_clear_all(float request) } } -void GameCommand_delrec(float request, float argc) // perhaps merge later with records and printstats and such? +void GameCommand_delrec(int request, int argc) // perhaps merge later with records and printstats and such? { switch (request) { @@ -605,7 +605,7 @@ void GameCommand_delrec(float request, float argc) // perhaps merge later with } } -void GameCommand_effectindexdump(float request) +void GameCommand_effectindexdump(int request) { switch (request) { @@ -719,7 +719,7 @@ void GameCommand_effectindexdump(float request) } } -void GameCommand_extendmatchtime(float request) +void GameCommand_extendmatchtime(int request) { switch (request) { @@ -740,7 +740,7 @@ void GameCommand_extendmatchtime(float request) } } -void GameCommand_gametype(float request, float argc) +void GameCommand_gametype(int request, int argc) { switch (request) { @@ -790,7 +790,7 @@ void GameCommand_gametype(float request, float argc) } } -void GameCommand_gettaginfo(float request, float argc) +void GameCommand_gettaginfo(int request, int argc) { switch (request) { @@ -855,7 +855,7 @@ void GameCommand_gettaginfo(float request, float argc) } } -void GameCommand_animbench(float request, float argc) +void GameCommand_animbench(int request, int argc) { switch (request) { @@ -914,7 +914,7 @@ void GameCommand_animbench(float request, float argc) } } -void GameCommand_gotomap(float request, float argc) +void GameCommand_gotomap(int request, int argc) { switch (request) { @@ -939,7 +939,7 @@ void GameCommand_gotomap(float request, float argc) } } -void GameCommand_lockteams(float request) +void GameCommand_lockteams(int request) { switch (request) { @@ -968,7 +968,7 @@ void GameCommand_lockteams(float request) } } -void GameCommand_make_mapinfo(float request) +void GameCommand_make_mapinfo(int request) { switch (request) { @@ -994,7 +994,7 @@ void GameCommand_make_mapinfo(float request) } } -void GameCommand_moveplayer(float request, float argc) +void GameCommand_moveplayer(int request, int argc) { switch (request) { @@ -1179,7 +1179,7 @@ void GameCommand_moveplayer(float request, float argc) } } -void GameCommand_nospectators(float request) +void GameCommand_nospectators(int request) { switch (request) { @@ -1208,7 +1208,7 @@ void GameCommand_nospectators(float request) } } -void GameCommand_printstats(float request) +void GameCommand_printstats(int request) { switch (request) { @@ -1229,7 +1229,7 @@ void GameCommand_printstats(float request) } } -void GameCommand_radarmap(float request, float argc) +void GameCommand_radarmap(int request, int argc) { switch (request) { @@ -1251,7 +1251,7 @@ void GameCommand_radarmap(float request, float argc) } } -void GameCommand_reducematchtime(float request) +void GameCommand_reducematchtime(int request) { switch (request) { @@ -1272,7 +1272,7 @@ void GameCommand_reducematchtime(float request) } } -void GameCommand_setbots(float request, float argc) +void GameCommand_setbots(int request, int argc) { switch (request) { @@ -1299,7 +1299,7 @@ void GameCommand_setbots(float request, float argc) } } -void GameCommand_shuffleteams(float request) +void GameCommand_shuffleteams(int request) { switch (request) { @@ -1357,7 +1357,7 @@ void GameCommand_shuffleteams(float request) } } -void GameCommand_stuffto(float request, float argc) +void GameCommand_stuffto(int request, int argc) { // This... is a fairly dangerous and powerful command... - It allows any arguments to be sent to a client via rcon. // Because of this, it is disabled by default and must be enabled by the server owner when doing compilation. That way, @@ -1406,7 +1406,7 @@ void GameCommand_stuffto(float request, float argc) #endif } -void GameCommand_trace(float request, float argc) +void GameCommand_trace(int request, int argc) { switch (request) { @@ -1582,7 +1582,7 @@ void GameCommand_trace(float request, float argc) } } -void GameCommand_unlockteams(float request) +void GameCommand_unlockteams(int request) { switch (request) { @@ -1611,7 +1611,7 @@ void GameCommand_unlockteams(float request) } } -void GameCommand_warp(float request, float argc) +void GameCommand_warp(int request, int argc) { switch (request) { @@ -1650,7 +1650,7 @@ void GameCommand_warp(float request, float argc) /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void GameCommand_(float request) +void GameCommand_(int request) { switch(request) { @@ -1713,7 +1713,7 @@ void GameCommand_macro_help() FOREACH(SERVER_COMMANDS, true, { LOG_INFOF(" ^2%s^7: %s", it.m_name, it.m_description); }); } -float GameCommand_macro_command(float argc, string command) +float GameCommand_macro_command(int argc, string command) { string c = strtolower(argv(0)); FOREACH(SERVER_COMMANDS, it.m_name == c, { @@ -1723,7 +1723,7 @@ float GameCommand_macro_command(float argc, string command) return false; } -float GameCommand_macro_usage(float argc) +float GameCommand_macro_usage(int argc) { string c = strtolower(argv(1)); FOREACH(SERVER_COMMANDS, it.m_name == c, { @@ -1746,7 +1746,7 @@ void GameCommand_macro_write_aliases(float fh) void GameCommand(string command) { - float argc = tokenize_console(command); + int argc = tokenize_console(command); // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index b990888e6..6d9b4d76e 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -515,7 +515,7 @@ float Votecommand_check_assignment(entity caller, float assignment) return false; } -string VoteCommand_extractcommand(string input, float startpos, float argc) +string VoteCommand_extractcommand(string input, float startpos, int argc) { string output; @@ -572,7 +572,7 @@ string ValidateMap(string validated_map, entity caller) return validated_map; } -float VoteCommand_checkargs(float startpos, float argc) +float VoteCommand_checkargs(float startpos, int argc) { float p, q, check, minargs; string cvarname = strcat("sv_vote_command_restriction_", argv(startpos)); @@ -646,7 +646,7 @@ float VoteCommand_checkargs(float startpos, float argc) return true; } -int VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, float argc) +int VoteCommand_parse(entity caller, string vote_command, string vote_list, float startpos, int argc) { string first_command = argv(startpos); int missing_chars = argv_start_index(startpos); @@ -731,7 +731,7 @@ int VoteCommand_parse(entity caller, string vote_command, string vote_list, floa // Command Sub-Functions // ======================= -void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY +void VoteCommand_abstain(int request, entity caller) // CLIENT ONLY { switch (request) { @@ -763,7 +763,7 @@ void VoteCommand_abstain(float request, entity caller) // CLIENT ONLY } } -void VoteCommand_call(float request, entity caller, float argc, string vote_command) // BOTH +void VoteCommand_call(int request, entity caller, int argc, string vote_command) // BOTH { switch (request) { @@ -850,7 +850,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm } } -void VoteCommand_master(float request, entity caller, float argc, string vote_command) // CLIENT ONLY +void VoteCommand_master(int request, entity caller, int argc, string vote_command) // CLIENT ONLY { switch (request) { @@ -965,7 +965,7 @@ void VoteCommand_master(float request, entity caller, float argc, string vote_co } } -void VoteCommand_no(float request, entity caller) // CLIENT ONLY +void VoteCommand_no(int request, entity caller) // CLIENT ONLY { switch (request) { @@ -1003,7 +1003,7 @@ void VoteCommand_no(float request, entity caller) // CLIENT ONLY } } -void VoteCommand_status(float request, entity caller) // BOTH +void VoteCommand_status(int request, entity caller) // BOTH { switch (request) { @@ -1025,7 +1025,7 @@ void VoteCommand_status(float request, entity caller) // BOTH } } -void VoteCommand_stop(float request, entity caller) // BOTH +void VoteCommand_stop(int request, entity caller) // BOTH { switch (request) { @@ -1047,7 +1047,7 @@ void VoteCommand_stop(float request, entity caller) // BOTH } } -void VoteCommand_yes(float request, entity caller) // CLIENT ONLY +void VoteCommand_yes(int request, entity caller) // CLIENT ONLY { switch (request) { @@ -1082,7 +1082,7 @@ void VoteCommand_yes(float request, entity caller) // CLIENT ONLY /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! -void VoteCommand_(float request) +void VoteCommand_(int request) { switch(request) { @@ -1120,7 +1120,7 @@ void VoteCommand_(float request) VOTE_COMMAND("yes", VoteCommand_yes(request, caller), "Select yes in current vote", VC_ASGNMNT_CLIENTONLY) \ /* nothing */ -void VoteCommand_macro_help(entity caller, float argc) +void VoteCommand_macro_help(entity caller, int argc) { string command_origin = GetCommandPrefix(caller); @@ -1153,7 +1153,7 @@ void VoteCommand_macro_help(entity caller, float argc) } } -float VoteCommand_macro_command(entity caller, float argc, string vote_command) +float VoteCommand_macro_command(entity caller, int argc, string vote_command) { #define VOTE_COMMAND(name, function, description, assignment) \ { if (Votecommand_check_assignment(caller, assignment)) { if (name == strtolower(argv(1))) { function; return true; } } } @@ -1169,7 +1169,7 @@ float VoteCommand_macro_command(entity caller, float argc, string vote_command) // Main function handling vote commands // ====================================== -void VoteCommand(float request, entity caller, float argc, string vote_command) +void VoteCommand(int request, entity caller, int argc, string vote_command) { // Guide for working with argc arguments by example: // argc: 1 - 2 - 3 - 4 diff --git a/qcsrc/server/command/vote.qh b/qcsrc/server/command/vote.qh index d5c3bc0ad..988e91bbc 100644 --- a/qcsrc/server/command/vote.qh +++ b/qcsrc/server/command/vote.qh @@ -41,7 +41,7 @@ string vote_parsed_display; // visual string which is fixed after being parsed // allow functions to be used in other code like g_world.qc and teamplay.qc void VoteThink(); void VoteReset(); -void VoteCommand(float request, entity caller, float argc, string vote_command); +void VoteCommand(int request, entity caller, int argc, string vote_command); // warmup and nagger stuff const float RESTART_COUNTDOWN = 10; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index d2a695aeb..3aed06ee4 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -25,7 +25,7 @@ float currentbots; float bots_would_leave; void UpdateFrags(entity player, int f); -.float totalfrags; +.int totalfrags; // flag set on worldspawn so that the code knows if it is dedicated or not float server_is_dedicated; @@ -41,7 +41,7 @@ float server_is_dedicated; //.float worldtype; // Needed for dynamic clientwalls -.float inactive; // Clientwall disappears when inactive +.bool inactive; // Clientwall disappears when inactive .float alpha_max, alpha_min; .float fade_start, fade_end, fade_vertical_offset; .float default_solid; // Variable to store default .solid for clientwalls @@ -213,7 +213,7 @@ float assault_attacker_team; float ServerProgsDB; float TemporaryDB; -.float team_saved; +.int team_saved; bool some_spawn_has_been_used; int have_team_spawns; // 0 = no team spawns requested, -1 = team spawns requested but none found, 1 = team spawns requested and found @@ -308,9 +308,9 @@ float client_cefc_accumulatortime; .float weapon_load[Weapons_MAX]; .int ammo_none; // used by the reloading system, must always be 0 -.float clip_load; -.float old_clip_load; -.float clip_size; +.int clip_load; +.int old_clip_load; +.int clip_size; .int minelayer_mines; .float vortex_charge; @@ -327,9 +327,9 @@ float client_cefc_accumulatortime; // when doing this, hagar can go through clones // #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_BBOX -.float spectatee_status; -.float zoomstate; -.float restriction; +.int spectatee_status; +.bool zoomstate; +.int restriction; .entity clientdata; .entity personal; @@ -339,24 +339,24 @@ string deathmessage; .bool just_joined; .float cvar_cl_weaponimpulsemode; -.float selectweapon; // last selected weapon of the player +.int selectweapon; // last selected weapon of the player .float ballistics_density; // wall piercing factor, larger = bullet can pass through more -const float ACTIVE_NOT = 0; -const float ACTIVE_ACTIVE = 1; -const float ACTIVE_IDLE = 2; -const float ACTIVE_BUSY = 2; -const float ACTIVE_TOGGLE = 3; -.float active; +const int ACTIVE_NOT = 0; +const int ACTIVE_ACTIVE = 1; +const int ACTIVE_IDLE = 2; +const int ACTIVE_BUSY = 2; +const int ACTIVE_TOGGLE = 3; +.int active; .void (entity this, int act_state) setactive; .entity realowner; //float serverflags; -.float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator +.int team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator -.float player_blocked; +.bool player_blocked; .float revival_time; // time at which player was last revived .float revive_speed; // NOTE: multiplier (anything above 1 is instaheal) @@ -376,7 +376,7 @@ USING(spawn_evalfunc_t, vector(entity this, entity player, entity spot, vector c string modname; -.float missile_flags; +.int missile_flags; const int MIF_SPLASH = BIT(1); const int MIF_ARC = BIT(2); const int MIF_PROXY = BIT(3); diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index 0af110c9e..617eca198 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -49,7 +49,7 @@ float damage_gooddamage; .float teamkill_soundtime; .entity teamkill_soundsource; .entity pusher; -.float istypefrag; +.bool istypefrag; .float taunt_soundtime; float IsFlying(entity a); diff --git a/qcsrc/server/ipban.qc b/qcsrc/server/ipban.qc index 2c0af1c8f..7b1f69384 100644 --- a/qcsrc/server/ipban.qc +++ b/qcsrc/server/ipban.qc @@ -197,7 +197,7 @@ LABEL(skip) void OnlineBanList_Think(entity this) { - float argc; + int argc; string uri; float i, n; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 444427784..7ed094cc3 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -889,7 +889,7 @@ void remove_safely(entity e) builtin_remove(e); } -void InitializeEntity(entity e, void(entity this) func, float order) +void InitializeEntity(entity e, void(entity this) func, int order) { entity prev, cur; diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index fc1fd5bd1..ff62cd167 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -326,17 +326,17 @@ void readlevelcvars() //#NO AUTOCVARS END -const float INITPRIO_FIRST = 0; -const float INITPRIO_GAMETYPE = 0; -const float INITPRIO_GAMETYPE_FALLBACK = 1; -const float INITPRIO_FINDTARGET = 10; -const float INITPRIO_DROPTOFLOOR = 20; -const float INITPRIO_SETLOCATION = 90; -const float INITPRIO_LINKDOORS = 91; -const float INITPRIO_LAST = 99; +const int INITPRIO_FIRST = 0; +const int INITPRIO_GAMETYPE = 0; +const int INITPRIO_GAMETYPE_FALLBACK = 1; +const int INITPRIO_FINDTARGET = 10; +const int INITPRIO_DROPTOFLOOR = 20; +const int INITPRIO_SETLOCATION = 90; +const int INITPRIO_LINKDOORS = 91; +const int INITPRIO_LAST = 99; .void(entity this) initialize_entity; -.float initialize_entity_order; +.int initialize_entity_order; .entity initialize_entity_next; entity initialize_entity_first; @@ -344,8 +344,8 @@ entity initialize_entity_first; -float sound_allowed(float dest, entity e); -void InitializeEntity(entity e, void(entity this) func, float order); +bool sound_allowed(int dest, entity e); +void InitializeEntity(entity e, void(entity this) func, int order); IntrusiveList g_ctrace_changed; STATIC_INIT(g_ctrace_changed) { g_ctrace_changed = IL_NEW(); } diff --git a/qcsrc/server/player.qh b/qcsrc/server/player.qh index 1c38a9fbe..2853f7f6d 100644 --- a/qcsrc/server/player.qh +++ b/qcsrc/server/player.qh @@ -2,7 +2,7 @@ .entity pusher; .float pushltime; -.float istypefrag; +.bool istypefrag; .float CopyBody_nextthink; .void(entity this) CopyBody_think; diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index ae64e74e4..d347fcbaf 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -86,7 +86,7 @@ void round_handler_FirstThink(entity this) this.nextthink = max(time, game_starttime); } -void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, void() roundStart_func) +void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func) { if (round_handler) { diff --git a/qcsrc/server/round_handler.qh b/qcsrc/server/round_handler.qh index e6b17b0e7..5979eb5c3 100644 --- a/qcsrc/server/round_handler.qh +++ b/qcsrc/server/round_handler.qh @@ -3,17 +3,17 @@ entity round_handler; .float delay; // stores delay from round end to countdown start .float count; // stores initial number of the countdown -.float wait; // it's set to true when round ends, to false when countdown starts +.bool wait; // it's set to true when round ends, to false when countdown starts .float cnt; // its initial value is .count + 1, then decreased while counting down // reaches 0 when the round starts .float round_timelimit; .float round_endtime; -.float() canRoundStart; -.float() canRoundEnd; +.bool() canRoundStart; +.bool() canRoundEnd; .void() roundStart; void round_handler_Init(float the_delay, float the_count, float the_round_timelimit); -void round_handler_Spawn(float() canRoundStart_func, float() canRoundEnd_func, void() roundStart_func); +void round_handler_Spawn(bool() canRoundStart_func, bool() canRoundEnd_func, void() roundStart_func); void round_handler_Reset(float next_think); void round_handler_Remove(); -- 2.39.2