]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
In minstagib when the player gets killed by running out of ammo do not reset immediat...
authorterencehill <piuntn@gmail.com>
Sun, 11 Dec 2011 21:36:28 +0000 (22:36 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 11 Dec 2011 21:36:28 +0000 (22:36 +0100)
qcsrc/server/cl_client.qc
qcsrc/server/g_world.qc
qcsrc/server/w_minstanex.qc

index 3d393755a0f3749d33793dc7b6de1e574c1284c2..2e3a333a8e5208a185753d6061ba36d66d4e230f 100644 (file)
@@ -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);
 
index d0474b8ed4e92633c8ee3a83747db22eff59ea99..4ddbcb1a8550242ebcf85e365af19fa855566b14 100644 (file)
@@ -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");
index 1dfc281732e88925f33887d24969700bb98d30d8..68ba4da69b39876dbe6f7f5fb9c797ae0528544a 100644 (file)
@@ -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;