From b9b7114ea4f553130e727a77029eece79a041cee Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 4 Jan 2017 19:59:26 +0100 Subject: [PATCH] Rename gameover to game_stopped as it makes more sense now. Proper game over check is if(intermission_running) --- qcsrc/client/view.qc | 4 +-- .../gamemodes/gamemode/nexball/nexball.qc | 4 +-- .../gamemode/onslaught/sv_onslaught.qc | 10 +++---- qcsrc/common/monsters/sv_monsters.qc | 4 +-- .../common/mutators/mutator/buffs/sv_buffs.qc | 14 +++++----- .../mutator/campcheck/sv_campcheck.qc | 2 +- .../mutators/mutator/instagib/sv_instagib.qc | 2 +- qcsrc/common/mutators/mutator/nades/nades.qc | 2 +- qcsrc/common/mutators/mutator/nix/sv_nix.qc | 2 +- .../mutators/mutator/overkill/sv_overkill.qc | 2 +- .../random_gravity/sv_random_gravity.qc | 2 +- .../mutator/touchexplode/sv_touchexplode.qc | 2 +- qcsrc/common/stats.qh | 4 +-- qcsrc/common/triggers/target/voicescript.qc | 2 +- qcsrc/common/vehicles/sv_vehicles.qc | 2 +- qcsrc/common/vehicles/vehicle/bumblebee.qc | 2 +- qcsrc/common/vehicles/vehicle/racer.qc | 2 +- qcsrc/common/vehicles/vehicle/raptor.qc | 2 +- qcsrc/common/vehicles/vehicle/spiderbot.qc | 2 +- qcsrc/ecs/systems/sv_physics.qc | 2 +- qcsrc/server/bot/default/bot.qc | 2 +- qcsrc/server/client.qc | 27 +++++++++---------- qcsrc/server/command/cmd.qc | 2 +- qcsrc/server/command/vote.qc | 6 ++--- qcsrc/server/g_damage.qc | 4 +-- qcsrc/server/g_hook.qc | 2 +- qcsrc/server/g_world.qc | 9 +++---- qcsrc/server/impulse.qc | 2 +- qcsrc/server/miscfunctions.qc | 2 +- .../mutators/mutator/gamemode_assault.qc | 4 +-- qcsrc/server/mutators/mutator/gamemode_ctf.qc | 4 +-- qcsrc/server/mutators/mutator/gamemode_cts.qc | 2 +- .../mutators/mutator/gamemode_domination.qc | 2 +- .../mutators/mutator/gamemode_freezetag.qc | 2 +- .../mutators/mutator/gamemode_keepaway.qc | 6 ++--- .../mutators/mutator/gamemode_keyhunt.qc | 8 +++--- qcsrc/server/mutators/mutator/gamemode_lms.qc | 2 +- .../server/mutators/mutator/gamemode_race.qc | 2 +- qcsrc/server/player.qc | 4 +-- qcsrc/server/round_handler.qc | 6 ++--- qcsrc/server/scores.qc | 12 ++++----- qcsrc/server/sv_main.qc | 2 +- qcsrc/server/weapons/weaponsystem.qc | 4 +-- 43 files changed, 91 insertions(+), 93 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 62783112e..ba53c0341 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -759,7 +759,7 @@ bool WantEventchase(entity this) { if(autocvar_cl_orthoview) return false; - if(STAT(GAMEOVER) || intermission) + if(STAT(GAME_STOPPED) || intermission) return true; if(this.viewloc) return true; @@ -961,7 +961,7 @@ void HUD_Crosshair(entity this) { float f, i, j; vector v; - if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAMEOVER) && + if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) && !HUD_MinigameMenu_IsOpened() ) { diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index a9bd737ca..0a9d2e4ba 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -234,7 +234,7 @@ void DropBall(entity ball, vector org, vector vel) void InitBall(entity this) { - if(gameover) return; + if(game_stopped) return; UNSET_ONGROUND(this); set_movetype(this, MOVETYPE_BOUNCE); if(this.classname == "nexball_basketball") @@ -362,7 +362,7 @@ void GoalTouch(entity this, entity toucher) float isclient, pscore, otherteam; string pname; - if(gameover) return; + if(game_stopped) return; if((this.spawnflags & GOAL_TOUCHPLAYER) && toucher.ballcarried) ball = toucher.ballcarried; else diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 195a3bd98..5d67f9d62 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -870,9 +870,9 @@ void ons_camSetup(entity this) void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) { - if(damage <= 0) { return; } - if(warmup_stage || gameover) { return; } - if(!round_handler_IsRoundStarted()) { return; } + if(damage <= 0) return; + if(warmup_stage || game_stopped) return; + if(!round_handler_IsRoundStarted()) return; if (attacker != this) { @@ -955,7 +955,7 @@ void ons_GeneratorDamage(entity this, entity inflictor, entity attacker, float d void ons_GeneratorThink(entity this) { this.nextthink = time + GEN_THINKRATE; - if (!gameover) + if (!game_stopped) { if(!this.isshielded && this.wait < time) { @@ -2021,7 +2021,7 @@ MUTATOR_HOOKFUNCTION(ons, SV_ParseClientCommand) MUTATOR_HOOKFUNCTION(ons, PlayerUseKey) { - if(MUTATOR_RETURNVALUE || gameover) { return false; } + if(MUTATOR_RETURNVALUE || game_stopped) return false; entity player = M_ARGV(0, entity); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index c7d5190e0..1f8f50790 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -782,7 +782,7 @@ void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) entity targ = this.goalentity; if (MUTATOR_CALLHOOK(MonsterMove, this, runspeed, walkspeed, targ) - || gameover + || game_stopped || this.draggedby != NULL || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || time < game_starttime @@ -1115,7 +1115,7 @@ void Monster_Damage(entity this, entity inflictor, entity attacker, float damage // don't check for enemies, just keep walking in a straight line void Monster_Move_2D(entity this, float mspeed, bool allow_jumpoff) { - if(gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != NULL || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time) + if(game_stopped || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || this.draggedby != NULL || time < game_starttime || (autocvar_g_campaign && !campaign_bots_may_start) || time < this.spawn_time) { mspeed = 0; if(time >= this.spawn_time) diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index afd1ba716..7f2f084ee 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -114,7 +114,7 @@ void buff_SetCooldown(entity this, float cd) void buff_Respawn(entity this) { - if(gameover) { return; } + if(game_stopped) return; vector oldbufforigin = this.origin; this.velocity = '0 0 200'; @@ -149,7 +149,7 @@ void buff_Respawn(entity this) void buff_Touch(entity this, entity toucher) { - if(gameover) { return; } + if(game_stopped) return; if(ITEM_TOUCH_NEEDKILL()) { @@ -248,7 +248,7 @@ void buff_Think(entity this) this.oldbuffs = this.buffs; } - if(!gameover) + if(!game_stopped) if((round_handler_IsActive() && !round_handler_IsRoundStarted()) || time >= game_starttime) if(!this.buff_activetime_updated) { @@ -269,7 +269,7 @@ void buff_Think(entity this) } if(this.buff_activetime) - if(!gameover) + if(!game_stopped) if((round_handler_IsActive() && !round_handler_IsRoundStarted()) || time >= game_starttime) { this.buff_activetime = max(0, this.buff_activetime - frametime); @@ -632,7 +632,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerDies) MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST) { - if(MUTATOR_RETURNVALUE || gameover) { return; } + if(MUTATOR_RETURNVALUE || game_stopped) return; entity player = M_ARGV(0, entity); @@ -651,7 +651,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerUseKey, CBC_ORDER_FIRST) MUTATOR_HOOKFUNCTION(buffs, ForbidThrowCurrentWeapon) { - if(MUTATOR_RETURNVALUE || gameover) { return; } + if(MUTATOR_RETURNVALUE || game_stopped) return; entity player = M_ARGV(0, entity); if(player.buffs & BUFF_SWAPPER.m_itemid) @@ -795,7 +795,7 @@ MUTATOR_HOOKFUNCTION(buffs, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(gameover || IS_DEAD(player)) { return; } + if(game_stopped || IS_DEAD(player)) return; if(time < player.buff_disability_time) if(time >= player.buff_disability_effect_time) diff --git a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc index 36da631bb..41f538b7a 100644 --- a/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc +++ b/qcsrc/common/mutators/mutator/campcheck/sv_campcheck.qc @@ -34,7 +34,7 @@ MUTATOR_HOOKFUNCTION(campcheck, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(!gameover) + if(!game_stopped) if(!warmup_stage) // don't consider it camping during warmup? if(time >= game_starttime) if(IS_PLAYER(player)) diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index 88bb8c0d9..af8788571 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -54,7 +54,7 @@ void instagib_ammocheck(entity this) if(!IS_PLAYER(this)) return; // not a player - if(IS_DEAD(this) || gameover) + if(IS_DEAD(this) || game_stopped) instagib_stop_countdown(this); else if (this.ammo_cells > 0 || (this.items & IT_UNLIMITED_WEAPON_AMMO) || (this.flags & FL_GODMODE)) instagib_stop_countdown(this); diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 5bf0360fd..627321ea0 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -1106,7 +1106,7 @@ bool CanThrowNade(entity this) if(this.vehicle) return false; - if(gameover) + if(game_stopped) return false; if(IS_DEAD(this)) diff --git a/qcsrc/common/mutators/mutator/nix/sv_nix.qc b/qcsrc/common/mutators/mutator/nix/sv_nix.qc index fb995a10a..135e50793 100644 --- a/qcsrc/common/mutators/mutator/nix/sv_nix.qc +++ b/qcsrc/common/mutators/mutator/nix/sv_nix.qc @@ -279,7 +279,7 @@ MUTATOR_HOOKFUNCTION(nix, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(!gameover) + if(!game_stopped) if(!IS_DEAD(player)) if(IS_PLAYER(player)) NIX_GiveCurrentWeapon(player); diff --git a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index db030b94c..49ecb55da 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -110,7 +110,7 @@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon) MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) { - if(gameover) + if(game_stopped) return; entity player = M_ARGV(0, entity); diff --git a/qcsrc/common/mutators/mutator/random_gravity/sv_random_gravity.qc b/qcsrc/common/mutators/mutator/random_gravity/sv_random_gravity.qc index f6f28a7dc..db361850d 100644 --- a/qcsrc/common/mutators/mutator/random_gravity/sv_random_gravity.qc +++ b/qcsrc/common/mutators/mutator/random_gravity/sv_random_gravity.qc @@ -24,7 +24,7 @@ float gravity_delay; MUTATOR_HOOKFUNCTION(random_gravity, SV_StartFrame) { - if(gameover || !cvar("g_random_gravity")) return false; + if(game_stopped || !cvar("g_random_gravity")) return false; if(time < gravity_delay) return false; if(time < game_starttime) return false; if(round_handler_IsActive() && !round_handler_IsRoundStarted()) return false; diff --git a/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc b/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc index 38ac30595..ddcd89160 100644 --- a/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc +++ b/qcsrc/common/mutators/mutator/touchexplode/sv_touchexplode.qc @@ -28,7 +28,7 @@ MUTATOR_HOOKFUNCTION(touchexplode, PlayerPreThink) entity player = M_ARGV(0, entity); if(time > player.touchexplode_time) - if(!gameover) + if(!game_stopped) if(!STAT(FROZEN, player)) if(IS_PLAYER(player)) if(!IS_DEAD(player)) diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 9b7d4a350..3d21280e0 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -57,10 +57,10 @@ REGISTER_STAT(KH_KEYS, int) #ifdef SVQC float W_WeaponRateFactor(entity this); -float gameover; +float game_stopped; #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) -REGISTER_STAT(GAMEOVER, int, gameover) +REGISTER_STAT(GAME_STOPPED, int, game_stopped) REGISTER_STAT(GAMESTARTTIME, float) REGISTER_STAT(STRENGTH_FINISHED, float) REGISTER_STAT(INVINCIBLE_FINISHED, float) diff --git a/qcsrc/common/triggers/target/voicescript.qc b/qcsrc/common/triggers/target/voicescript.qc index fe7155cc5..6dfb568a8 100644 --- a/qcsrc/common/triggers/target/voicescript.qc +++ b/qcsrc/common/triggers/target/voicescript.qc @@ -32,7 +32,7 @@ void target_voicescript_next(entity pl) return; if (!IS_PLAYER(pl)) return; - if(gameover) + if(game_stopped) return; if(time >= pl.voicescript_voiceend) diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 1bbc18d9c..4e4bfd584 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -541,7 +541,7 @@ void vehicle_use(entity this, entity actor, entity trigger) else this.active = ACTIVE_ACTIVE; - if(this.active == ACTIVE_ACTIVE && !IS_DEAD(this) && !gameover) + if(this.active == ACTIVE_ACTIVE && !IS_DEAD(this) && !game_stopped) { LOG_DEBUG("Respawning vehicle: ", this.netname); if(this.effects & EF_NODRAW) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index a4f4beca6..01edce67a 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -402,7 +402,7 @@ bool bumblebee_pilot_frame(entity this, float dt) entity vehic = this.vehicle; return = true; - if(gameover) + if(game_stopped) { vehic.solid = SOLID_NOT; vehic.takedamage = DAMAGE_NO; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 4480ec658..7af872efd 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -151,7 +151,7 @@ bool racer_frame(entity this, float dt) entity vehic = this.vehicle; return = true; - if(gameover) + if(game_stopped) { vehic.solid = SOLID_NOT; vehic.takedamage = DAMAGE_NO; diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 2b349e11d..19ac988c5 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -133,7 +133,7 @@ bool raptor_frame(entity this, float dt) entity vehic = this.vehicle; return = true; - if(gameover) + if(game_stopped) { vehic.solid = SOLID_NOT; vehic.takedamage = DAMAGE_NO; diff --git a/qcsrc/common/vehicles/vehicle/spiderbot.qc b/qcsrc/common/vehicles/vehicle/spiderbot.qc index ccc509c6b..1c651b16a 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot.qc +++ b/qcsrc/common/vehicles/vehicle/spiderbot.qc @@ -48,7 +48,7 @@ bool spiderbot_frame(entity this, float dt) entity vehic = this.vehicle; return = true; - if(gameover) + if(game_stopped) { vehic.solid = SOLID_NOT; vehic.takedamage = DAMAGE_NO; diff --git a/qcsrc/ecs/systems/sv_physics.qc b/qcsrc/ecs/systems/sv_physics.qc index 4973a1829..aaef9f383 100644 --- a/qcsrc/ecs/systems/sv_physics.qc +++ b/qcsrc/ecs/systems/sv_physics.qc @@ -37,7 +37,7 @@ void sys_phys_ai(entity this) void sys_phys_pregame_hold(entity this) { if (!IS_PLAYER(this)) { return; } - const bool allowed_to_move = (time >= game_starttime && !gameover); + const bool allowed_to_move = (time >= game_starttime && !game_stopped); if (!allowed_to_move) { this.velocity = '0 0 0'; set_movetype(this, MOVETYPE_NONE); diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index fb6f1e046..160f8ec90 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -668,7 +668,7 @@ void bot_clear(entity this) void bot_serverframe() { - if (gameover) + if (game_stopped) return; if (time < 2) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 47064506f..eaa55cef5 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -279,7 +279,7 @@ void PutObserverInServer(entity this) if (this.killcount != FRAGS_SPECTATOR) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); - if(!gameover) + if(!game_stopped) if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2)) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS); @@ -484,9 +484,8 @@ void PutClientInServer(entity this) WriteByte(MSG_ONE, SVC_SETVIEW); WriteEntity(MSG_ONE, this); } - if (gameover) { + if (game_stopped) TRANSMUTE(Observer, this); - } SetSpectatee(this, NULL); @@ -871,7 +870,7 @@ void ClientKill_Now(entity this) } void KillIndicator_Think(entity this) { - if (gameover) + if (game_stopped) { this.owner.killindicator = NULL; delete(this); @@ -915,7 +914,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, float killtime; float starttime; - if (gameover) + if (game_stopped) return; killtime = autocvar_g_balance_kill_delay; @@ -1007,7 +1006,7 @@ void ClientKill_TeamChange (entity this, float targetteam) // 0 = don't change, void ClientKill (entity this) { - if(gameover) return; + if(game_stopped) return; if(this.player_blocked) return; if(STAT(FROZEN, this)) return; @@ -1389,7 +1388,7 @@ void player_powerups(entity this) // add a way to see what the items were BEFORE all of these checks for the mutator hook int items_prev = this.items; - if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !gameover) + if((this.items & IT_USING_JETPACK) && !IS_DEAD(this) && !game_stopped) this.modelflags |= MF_ROCKET; else this.modelflags &= ~MF_ROCKET; @@ -2153,7 +2152,7 @@ void PlayerUseKey(entity this) if(this.vehicle) { - if(!gameover) + if(!game_stopped) { vehicles_exit(this.vehicle, VHEF_NORMAL); return; @@ -2163,7 +2162,7 @@ void PlayerUseKey(entity this) { if(!STAT(FROZEN, this)) if(!IS_DEAD(this)) - if(!gameover) + if(!game_stopped) { entity head, closest_target = NULL; head = WarpZone_FindRadius(this.origin, autocvar_g_vehicles_enter_radius, true); @@ -2294,7 +2293,7 @@ void PlayerPreThink (entity this) MUTATOR_CALLHOOK(PlayerPreThink, this); - if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !gameover && !this.vehicle) + if(autocvar_g_vehicles_enter && (time > this.last_vehiclecheck) && !game_stopped && !this.vehicle) if(IS_PLAYER(this) && !STAT(FROZEN, this) && !IS_DEAD(this)) { FOREACH_ENTITY_RADIUS(this.origin, autocvar_g_vehicles_enter_radius, IS_VEHICLE(it), @@ -2329,7 +2328,7 @@ void PlayerPreThink (entity this) if (IS_PLAYER(this)) { CheckRules_Player(this); - if (gameover || intermission_running) { + if (game_stopped || intermission_running) { if(intermission_running) IntermissionThink(this); return; @@ -2500,7 +2499,7 @@ void PlayerPreThink (entity this) this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime); } - else if (gameover || intermission_running) { + else if (game_stopped || intermission_running) { if(intermission_running) IntermissionThink(this); return; @@ -2652,7 +2651,7 @@ void PlayerPostThink (entity this) CheatFrame(this); //CheckPlayerJump(); - if (gameover) + if (game_stopped) { this.solid = SOLID_NOT; this.takedamage = DAMAGE_NO; @@ -2664,7 +2663,7 @@ void PlayerPostThink (entity this) CheckRules_Player(this); UpdateChatBubble(this); if (this.impulse) ImpulseCommands(this); - if (gameover) + if (game_stopped) { CSQCMODEL_AUTOUPDATE(this); return; diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index ea9610b16..4f0e54d69 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -167,7 +167,7 @@ void ClientCommand_join(entity caller, float request) { case CMD_REQUEST_COMMAND: { - if (!gameover) + if (!game_stopped) if (IS_CLIENT(caller) && !IS_PLAYER(caller)) if (joinAllowed(caller)) Join(caller); diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index f7d3be0f0..f855b2f06 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -336,7 +336,7 @@ void reset_map(bool dorespawn) { if (time <= game_starttime) { - if (gameover) + if (game_stopped) return; if (round_handler_IsActive()) round_handler_Reset(game_starttime); @@ -405,7 +405,7 @@ void ReadyRestart_think(entity this) // Forces a restart of the game without actually reloading the map // this is a mess... void ReadyRestart_force() { - if (time <= game_starttime && gameover) + if (time <= game_starttime && game_stopped) return; bprint("^1Server is restarting...\n"); @@ -464,7 +464,7 @@ void ReadyRestart_force() void ReadyRestart() { - if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || gameover || race_completing) localcmd("restart\n"); + if (MUTATOR_CALLHOOK(ReadyRestart_Deny) || game_stopped || race_completing) localcmd("restart\n"); else localcmd("\nsv_hook_gamerestart\n"); // Reset ALL scores, but only do that at the beginning of the countdown if sv_ready_restart_after_countdown is off! diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index d5ad30104..259857ccd 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -33,7 +33,7 @@ void UpdateFrags(entity player, int f) void GiveFrags (entity attacker, entity targ, float f, int deathtype) { // TODO route through PlayerScores instead - if(gameover) return; + if(game_stopped) return; if(f < 0) { @@ -623,7 +623,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, int d mirrordamage = 0; mirrorforce = 0; - if (gameover || targ.killcount == FRAGS_SPECTATOR) + if (game_stopped || targ.killcount == FRAGS_SPECTATOR) return; damage_targ = targ; diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index a69b98487..ef4cbc5a6 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -163,7 +163,7 @@ void GrapplingHookThink(entity this) error("Owner lost the hook!\n"); return; } - if(LostMovetypeFollow(this) || gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) + if(LostMovetypeFollow(this) || game_stopped || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) { RemoveHook(this); return; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index b1246091b..f36b03b03 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1528,9 +1528,8 @@ only called if a time or frag limit has expired */ void NextLevel() { - gameover = true; - - intermission_running = 1; + game_stopped = true; + intermission_running = 1; // game over // enforce a wait time before allowing changelevel if(player_count > 0) @@ -1587,7 +1586,7 @@ Exit deathmatch games upon conditions */ void CheckRules_Player(entity this) { - if (gameover) // someone else quit the game already + if (game_stopped) // someone else quit the game already return; if(!IS_DEAD(this)) @@ -2160,7 +2159,7 @@ void RestoreGame() void Shutdown() { - gameover = 2; + game_stopped = 2; if(world_initialized > 0) { diff --git a/qcsrc/server/impulse.qc b/qcsrc/server/impulse.qc index ceca2ce91..c84c0de9a 100644 --- a/qcsrc/server/impulse.qc +++ b/qcsrc/server/impulse.qc @@ -352,7 +352,7 @@ IMPULSE(weapon_reload) void ImpulseCommands(entity this) { - if (gameover) return; + if (game_stopped) return; int imp = this.impulse; if (!imp) return; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 64c767e5f..6e2fdfc0f 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -479,7 +479,7 @@ void GetCvars(entity this, int f) string playername(entity p) { string t; - if (teamplay && !gameover && IS_PLAYER(p)) + if (teamplay && !game_stopped && IS_PLAYER(p)) { t = Team_ColorCode(p.team); return strcat(t, strdecolorize(p.netname)); diff --git a/qcsrc/server/mutators/mutator/gamemode_assault.qc b/qcsrc/server/mutators/mutator/gamemode_assault.qc index 28e91f26a..994a29719 100644 --- a/qcsrc/server/mutators/mutator/gamemode_assault.qc +++ b/qcsrc/server/mutators/mutator/gamemode_assault.qc @@ -213,7 +213,7 @@ entity as_round; .entity ent_winning; void as_round_think() { - gameover = false; + game_stopped = false; assault_new_round(as_round.ent_winning); delete(as_round); as_round = NULL; @@ -261,7 +261,7 @@ int WinningCondition_Assault() as_round.think = as_round_think; as_round.ent_winning = ent; as_round.nextthink = time + AS_ROUND_DELAY; - gameover = true; + game_stopped = true; // make sure timelimit isn't hit while the game is blocked if(autocvar_timelimit > 0) diff --git a/qcsrc/server/mutators/mutator/gamemode_ctf.qc b/qcsrc/server/mutators/mutator/gamemode_ctf.qc index 6036fa529..2e8707b26 100644 --- a/qcsrc/server/mutators/mutator/gamemode_ctf.qc +++ b/qcsrc/server/mutators/mutator/gamemode_ctf.qc @@ -1038,7 +1038,7 @@ void ctf_FlagThink(entity this) METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher)) { return = false; - if(gameover) { return; } + if(game_stopped) return; if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; } bool is_not_monster = (!IS_MONSTER(toucher)); @@ -2181,7 +2181,7 @@ MUTATOR_HOOKFUNCTION(ctf, PortalTeleport) MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey) { - if(MUTATOR_RETURNVALUE || gameover) { return; } + if(MUTATOR_RETURNVALUE || game_stopped) return; entity player = M_ARGV(0, entity); diff --git a/qcsrc/server/mutators/mutator/gamemode_cts.qc b/qcsrc/server/mutators/mutator/gamemode_cts.qc index 21098a5e9..903ecf595 100644 --- a/qcsrc/server/mutators/mutator/gamemode_cts.qc +++ b/qcsrc/server/mutators/mutator/gamemode_cts.qc @@ -228,7 +228,7 @@ MUTATOR_HOOKFUNCTION(cts, PutClientInServer) entity player = M_ARGV(0, entity); if(IS_PLAYER(player)) - if(!gameover) + if(!game_stopped) { if(player.killcount == FRAGS_SPECTATOR /* initial spawn */ || g_race_qualifying) // spawn race_PreparePlayer(player); diff --git a/qcsrc/server/mutators/mutator/gamemode_domination.qc b/qcsrc/server/mutators/mutator/gamemode_domination.qc index 7f98ed289..ee9bdfa87 100644 --- a/qcsrc/server/mutators/mutator/gamemode_domination.qc +++ b/qcsrc/server/mutators/mutator/gamemode_domination.qc @@ -153,7 +153,7 @@ void dompointthink(entity this) // give points - if (gameover || this.delay > time || time < game_starttime) // game has ended, don't keep giving points + if (game_stopped || this.delay > time || time < game_starttime) // game has ended, don't keep giving points return; if(autocvar_g_domination_point_rate) diff --git a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc index cec7d950e..69f55a3c8 100644 --- a/qcsrc/server/mutators/mutator/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/mutator/gamemode_freezetag.qc @@ -429,7 +429,7 @@ MUTATOR_HOOKFUNCTION(ft, GiveFragsForKill, CBC_ORDER_FIRST) MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST) { - if(gameover) + if(game_stopped) return true; if(round_handler_IsActive()) diff --git a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc index b948c6d5e..7677bdab5 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keepaway.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keepaway.qc @@ -41,7 +41,7 @@ void ka_TouchEvent(entity this, entity toucher); void ka_RespawnBall(entity this); void ka_RespawnBall(entity this) // runs whenever the ball needs to be relocated { - if(gameover) { return; } + if(game_stopped) return; vector oldballorigin = this.origin; if(!MoveToRandomMapLocation(this, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256)) @@ -83,8 +83,8 @@ void ka_TimeScoring(entity this) void ka_TouchEvent(entity this, entity toucher) // runs any time that the ball comes in contact with something { - if(gameover) { return; } - if(!this) { return; } + if(game_stopped) return; + if(!this) return; if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT) { // The ball fell off the map, respawn it since players can't get to it ka_RespawnBall(this); diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index d3ec3358e..32559afbc 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -157,7 +157,7 @@ void kh_Controller_SetThink(float t, kh_Think_t func) // runs occasionaly void kh_WaitForPlayers(); void kh_Controller_Think(entity this) // called a lot { - if(gameover) + if(game_stopped) return; if(this.cnt > 0) { @@ -177,7 +177,7 @@ void kh_Controller_Think(entity this) // called a lot void kh_Scores_Event(entity player, entity key, string what, float frags_player, float frags_owner) // update the score when a key is captured { string s; - if(gameover) + if(game_stopped) return; if(frags_player) @@ -448,7 +448,7 @@ void kh_Key_Collect(entity key, entity player) //a player picks up a dropped ke void kh_Key_Touch(entity this, entity toucher) // runs many, many times when a key has been dropped and can be picked up { - if(gameover) + if(game_stopped) return; if(this.owner) // already carried @@ -662,7 +662,7 @@ void kh_LoserTeam(int loser_team, entity lostkey) // runs when a player pushes void kh_Key_Think(entity this) // runs all the time { - if(gameover) + if(game_stopped) return; if(this.owner) diff --git a/qcsrc/server/mutators/mutator/gamemode_lms.qc b/qcsrc/server/mutators/mutator/gamemode_lms.qc index 25f6d3e0a..c3c24559e 100644 --- a/qcsrc/server/mutators/mutator/gamemode_lms.qc +++ b/qcsrc/server/mutators/mutator/gamemode_lms.qc @@ -414,7 +414,7 @@ MUTATOR_HOOKFUNCTION(lms, GetPlayerStatus) MUTATOR_HOOKFUNCTION(lms, AddPlayerScore) { - if(gameover) + if(game_stopped) if(M_ARGV(0, entity) == SP_LMS_RANK) // score field return true; // allow writing to this field in intermission as it is needed for newly joining players } diff --git a/qcsrc/server/mutators/mutator/gamemode_race.qc b/qcsrc/server/mutators/mutator/gamemode_race.qc index abe6b846e..3e93c1ed0 100644 --- a/qcsrc/server/mutators/mutator/gamemode_race.qc +++ b/qcsrc/server/mutators/mutator/gamemode_race.qc @@ -267,7 +267,7 @@ MUTATOR_HOOKFUNCTION(rc, PutClientInServer) entity player = M_ARGV(0, entity); if(IS_PLAYER(player)) - if(!gameover) + if(!game_stopped) { if(player.killcount == FRAGS_SPECTATOR /* initial spawn */ || g_race_qualifying) // spawn race_PreparePlayer(player); diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index 0fcf89fc7..6a20304f0 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -703,7 +703,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc teamsay = false; } - if(gameover) + if(game_stopped) teamsay = false; if (!source) { @@ -880,7 +880,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc if (!privatesay && source && !IS_PLAYER(source)) { - if (!gameover) + if (!game_stopped) if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)) teamsay = -1; // spectators } diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 063c12abb..6a18a6b5b 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -12,8 +12,8 @@ void round_handler_Think(entity this) return; } - if (gameover) - gameover = false; + if (game_stopped) + game_stopped = false; if (intermission_running) { @@ -59,7 +59,7 @@ void round_handler_Think(entity this) // schedule a new round this.wait = true; this.nextthink = time + this.delay; - gameover = true; + game_stopped = true; } else { diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index e6264b869..b46663043 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -99,20 +99,20 @@ float TeamScore_AddToTeam(float t, float scorefield, float score) { entity s; - if(gameover) + if(game_stopped) score = 0; if(!scores_initialized) return 0; // FIXME remove this when everything uses this system if(t <= 0 || t >= 16) { - if(gameover) + if(game_stopped) return 0; error("Adding score to invalid team!"); } s = teamscorekeepers[t - 1]; if(!s) { - if(gameover) + if(game_stopped) return 0; error("Adding score to unknown team!"); } @@ -324,7 +324,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) bool mutator_returnvalue = MUTATOR_CALLHOOK(AddPlayerScore, scorefield, score, player); score = M_ARGV(1, float); - if(gameover) + if(game_stopped) if(!mutator_returnvalue) score = 0; @@ -332,7 +332,7 @@ float PlayerScore_Add(entity player, PlayerScoreField scorefield, float score) entity s = player.scorekeeper; if(!s) { - if(gameover) + if(game_stopped) return 0; LOG_WARN("Adding score to unknown player!"); return 0; @@ -747,7 +747,7 @@ float TeamScore_GetCompareValue(float t) if(t <= 0 || t >= 16) { - if(gameover) + if(game_stopped) return 0; error("Reading score of invalid team!"); } diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index b510b43c8..144821879 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -230,7 +230,7 @@ void StartFrame() CreatureFrame_All(); CheckRules_World(); - if (warmup_stage && !gameover && warmup_limit > 0 && time >= warmup_limit) { + if (warmup_stage && !game_stopped && warmup_limit > 0 && time >= warmup_limit) { ReadyRestart(); return; } diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index a91f7916a..b36a67bfe 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -70,7 +70,7 @@ vector CL_Weapon_GetShotOrg(int wpn) void CL_Weaponentity_Think(entity this) { this.nextthink = time; - if (gameover) this.frame = this.anim_idle.x; + if (game_stopped) this.frame = this.anim_idle.x; .entity weaponentity = this.weaponentity_fld; if (this.owner.(weaponentity) != this) { @@ -419,7 +419,7 @@ bool forbidWeaponUse(entity player) { if (time < game_starttime && !autocvar_sv_ready_restart_after_countdown) return true; if (player.player_blocked) return true; - if (gameover) return true; + if (game_stopped) return true; if (STAT(FROZEN, player)) return true; if (player.weapon_blocked) return true; if (MUTATOR_CALLHOOK(ForbidWeaponUse, player)) return true; -- 2.39.2