From 4bf759765406e3ab5586e125919976239ecdacd7 Mon Sep 17 00:00:00 2001 From: terencehill Date: Mon, 12 Sep 2016 19:39:52 +0200 Subject: [PATCH] Respect meaning of intermission_running and gameover variable names (currently both are set at the same time) --- qcsrc/common/mutators/mutator/nix/sv_nix.qc | 2 +- .../mutators/mutator/overkill/sv_overkill.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/server/bot/default/bot.qc | 2 +- qcsrc/server/client.qc | 22 +++++++++++++------ qcsrc/server/command/vote.qc | 2 +- qcsrc/server/g_hook.qc | 2 +- qcsrc/server/g_world.qc | 7 ++---- qcsrc/server/miscfunctions.qc | 2 +- .../mutators/mutator/gamemode_keyhunt.qc | 8 +++---- qcsrc/server/player.qc | 8 +++---- qcsrc/server/weapons/weaponsystem.qc | 2 +- 15 files changed, 36 insertions(+), 31 deletions(-) diff --git a/qcsrc/common/mutators/mutator/nix/sv_nix.qc b/qcsrc/common/mutators/mutator/nix/sv_nix.qc index 97ed4361b..afbc9091d 100644 --- a/qcsrc/common/mutators/mutator/nix/sv_nix.qc +++ b/qcsrc/common/mutators/mutator/nix/sv_nix.qc @@ -267,7 +267,7 @@ MUTATOR_HOOKFUNCTION(nix, PlayerPreThink) { entity player = M_ARGV(0, entity); - if(!intermission_running) + if(!gameover) 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 ea7ed953c..eb40085d7 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -199,7 +199,7 @@ MUTATOR_HOOKFUNCTION(ok, ForbidThrowCurrentWeapon) MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) { - if(intermission_running || gameover) + if(gameover) return; entity player = M_ARGV(0, entity); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 3f5f40435..95cc74802 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -391,7 +391,7 @@ bool bumblebee_pilot_frame(entity this, float dt) entity vehic = this.vehicle; return = true; - if(intermission_running) + if(gameover) { 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 41a31743f..caec3b0b7 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(intermission_running) + if(gameover) { 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 1068e7430..7c433f9c7 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(intermission_running) + if(gameover) { 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 347d2120a..fcdd638b3 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(intermission_running) + if(gameover) { vehic.solid = SOLID_NOT; vehic.takedamage = DAMAGE_NO; diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index ca12d0d65..55c1bda6c 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -631,7 +631,7 @@ float bot_fixcount() void bot_serverframe() { - if (intermission_running) + if (gameover) return; if (time < 2) diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index dd9aab7fa..8120cfd20 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -283,8 +283,8 @@ void PutObserverInServer(entity this) if (this.killcount != FRAGS_SPECTATOR) { Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_QUIT_SPECTATE, this.netname); - if(!intermission_running) - if(autocvar_g_chat_nospectators == 1 || (!(warmup_stage || gameover) && autocvar_g_chat_nospectators == 2)) + if(!gameover) + if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2)) Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS); if(this.just_joined == false) { @@ -2301,8 +2301,15 @@ void PlayerPreThink (entity this) if (IS_PLAYER(this)) { CheckRules_Player(this); - if (intermission_running) { - IntermissionThink(this); + if (gameover || intermission_running) { + if(gameover) + { + this.solid = SOLID_NOT; + this.takedamage = DAMAGE_NO; + set_movetype(this, MOVETYPE_NONE); + } + if(intermission_running) + IntermissionThink(this); return; } @@ -2453,8 +2460,9 @@ void PlayerPreThink (entity this) this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime); } - else if (gameover) { - if (intermission_running) IntermissionThink(this); + else if (gameover || intermission_running) { + if(intermission_running) + IntermissionThink(this); return; } else if (IS_OBSERVER(this)) { @@ -2602,7 +2610,7 @@ void PlayerPostThink (entity this) CheckRules_Player(this); UpdateChatBubble(this); if (this.impulse) ImpulseCommands(this); - if (intermission_running) return; // intermission or finale + if (gameover) return; GetPressedKeys(this); } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 361f12844..c1b31d38c 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -455,7 +455,7 @@ void ReadyRestart_force() void ReadyRestart() { // no assault support yet... - if (g_assault | gameover | intermission_running | race_completing) localcmd("restart\n"); + if (g_assault || gameover || 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_hook.qc b/qcsrc/server/g_hook.qc index 90266189b..f7e26b0a4 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -143,7 +143,7 @@ void GrapplingHookThink(entity this) error("Owner lost the hook!\n"); return; } - if(LostMovetypeFollow(this) || intermission_running || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) + if(LostMovetypeFollow(this) || gameover || (round_handler_IsActive() && !round_handler_IsRoundStarted()) || ((this.aiment.flags & FL_PROJECTILE) && this.aiment.classname != "nade")) { RemoveGrapplingHook(this.realowner); return; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index fe7822bc1..39eeeb4f5 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1485,9 +1485,6 @@ void FixIntermissionClient(entity e) e.autoscreenshot = time + 0.8; // used for autoscreenshot e.health = -2342; // first intermission phase; voting phase has positive health (used to decide whether to send SVC_FINALE or not) - e.solid = SOLID_NOT; - set_movetype(e, MOVETYPE_NONE); - e.takedamage = DAMAGE_NO; for (int slot = 0; slot < MAX_WEAPONSLOTS; ++slot) { .entity weaponentity = weaponentities[slot]; @@ -1525,7 +1522,7 @@ void NextLevel() intermission_running = 1; -// enforce a wait time before allowing changelevel + // enforce a wait time before allowing changelevel if(player_count > 0) intermission_exittime = time + autocvar_sv_mapchange_delay; else @@ -1832,7 +1829,7 @@ void CheckRules_World() SetDefaultAlpha(); - if (gameover) // someone else quit the game already + if (intermission_running) // someone else quit the game already { if(player_count == 0) // Nobody there? Then let's go to the next map MapVote_Start(); diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 4b3d404bf..1b91304da 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -457,7 +457,7 @@ void GetCvars(entity this, int f) string playername(entity p) { string t; - if (teamplay && !intermission_running && IS_PLAYER(p)) + if (teamplay && !gameover && IS_PLAYER(p)) { t = Team_ColorCode(p.team); return strcat(t, strdecolorize(p.netname)); diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 781609a91..db62b8e9c 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(intermission_running) + if(gameover) return; if(this.cnt > 0) { if(getthink(this) != kh_WaitForPlayers) { this.cnt -= 1; } } @@ -174,7 +174,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(intermission_running) + if(gameover) return; if(frags_player) @@ -449,7 +449,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(intermission_running) + if(gameover) return; if(this.owner) // already carried @@ -672,7 +672,7 @@ void kh_LoserTeam(float teem, entity lostkey) // runs when a player pushes a fl void kh_Key_Think(entity this) // runs all the time { - if(intermission_running) + if(gameover) return; if(this.owner) diff --git a/qcsrc/server/player.qc b/qcsrc/server/player.qc index e95ae9819..8db3ec36b 100644 --- a/qcsrc/server/player.qc +++ b/qcsrc/server/player.qc @@ -701,7 +701,7 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc teamsay = false; } - if(intermission_running) + if(gameover) teamsay = false; if (!source) { @@ -878,9 +878,9 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc if (!privatesay && source && !IS_PLAYER(source)) { - if (!intermission_running) - if(teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !(warmup_stage || gameover))) - teamsay = -1; // spectators + if (!gameover) + if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)) + teamsay = -1; // spectators } if(flood) diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index 451c50ec1..0f3b08fe7 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -64,7 +64,7 @@ vector CL_Weapon_GetShotOrg(int wpn) void CL_Weaponentity_Think(entity this) { this.nextthink = time; - if (intermission_running) this.frame = this.anim_idle.x; + if (gameover) this.frame = this.anim_idle.x; .entity weaponentity = this.weaponentity_fld; if (this.owner.(weaponentity) != this) { -- 2.39.2