From: terencehill Date: Sun, 11 Dec 2011 21:36:28 +0000 (+0100) Subject: In minstagib when the player gets killed by running out of ammo do not reset immediat... X-Git-Tag: xonotic-v0.6.0~35^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=32cea895660be3d2051cd4e9f3d5d67b77709d3a;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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;