From 32cea895660be3d2051cd4e9f3d5d67b77709d3a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 11 Dec 2011 22:36:28 +0100 Subject: [PATCH] In minstagib when the player gets killed by running out of ammo do not reset immediately the health to 100. It fixes cl_eventchase_death not working in that case. Also stop the countdown when the game ends. --- qcsrc/server/cl_client.qc | 3 +-- qcsrc/server/g_world.qc | 3 ++- qcsrc/server/w_minstanex.qc | 21 ++++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 3d393755a..2e3a333a8 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -528,8 +528,7 @@ void PutObserverInServer (void) DropAllRunes(self); MUTATOR_CALLHOOK(MakePlayerObserver); - if (g_minstagib) - minstagib_stop_countdown(); + minstagib_stop_countdown(self); Portal_ClearAll(self); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index d0474b8ed..4ddbcb1a8 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1561,7 +1561,7 @@ void FixIntermissionClient(entity e) } } - +void minstagib_stop_countdown(entity e); /* go to the next level for deathmatch only called if a time or frag limit has expired @@ -1605,6 +1605,7 @@ void NextLevel() GameLogClose(); FOR_EACH_PLAYER(other) { + minstagib_stop_countdown(other); FixIntermissionClient(other); if(other.winning) bprint(other.netname, " ^7wins.\n"); diff --git a/qcsrc/server/w_minstanex.qc b/qcsrc/server/w_minstanex.qc index 1dfc28173..68ba4da69 100644 --- a/qcsrc/server/w_minstanex.qc +++ b/qcsrc/server/w_minstanex.qc @@ -89,22 +89,25 @@ void W_MinstaNex_Attack (void) .float minstagib_nextthink; .float minstagib_needammo; -void minstagib_stop_countdown(void) +void minstagib_stop_countdown(entity e) { - if (self.minstagib_needammo) - { - self.health = 100; - Send_CSQC_Centerprint_Generic_Expire(self, CPID_MINSTA_FINDAMMO); - } - self.minstagib_needammo = FALSE; + if (!e.minstagib_needammo) + return; + Send_CSQC_Centerprint_Generic_Expire(e, CPID_MINSTA_FINDAMMO); + e.minstagib_needammo = FALSE; } void minstagib_ammocheck(void) { if (time < self.minstagib_nextthink) return; - if (self.deadflag || gameover || self.ammo_cells > 0 || (self.items & IT_UNLIMITED_WEAPON_AMMO)) - minstagib_stop_countdown(); + if (self.deadflag || gameover) + minstagib_stop_countdown(self); + else if (self.ammo_cells > 0 || (self.items & IT_UNLIMITED_WEAPON_AMMO)) + { + minstagib_stop_countdown(self); + self.health = 100; + } else { self.minstagib_needammo = TRUE; -- 2.39.2