]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/g_grabber.qc
Use self.stat_eaten instead of checking self.predator.classname. Also adjust the...
[voretournament/voretournament.git] / data / qcsrc / server / g_grabber.qc
index 4ea53d329f61a9b3ea5fa57af3defbfaa947b9e3..f8ce6c0545c468fc2fd152f1e01217620701a494 100644 (file)
@@ -131,7 +131,7 @@ void GrabberThink()
                WarpZone_RefSys_AddIncrementally(self, self.aiment);\r
 \r
        // prevent the grabber from sticking to a player that has been swallowed\r
-       if(self.aiment.predator.classname == "player")\r
+       if(self.aiment.stat_eaten)\r
        {\r
                // if the grabber is linked to a player that we swallowed, disconnect it (or the grabber will stick to us / the player inside us)\r
                // otherwise, link the grabber to the player who ate our linked player\r
@@ -264,8 +264,16 @@ void GrabberTouch (void)
        if(other)\r
                if(other.movetype != MOVETYPE_NONE)\r
                {\r
+                       if(other.classname == "player")\r
+                       {\r
+                               if(other.BUTTON_CHAT)\r
+                                       self.owner.typehitsound += 1;\r
+                               else\r
+                                       self.owner.hitsound += 1; // play this for team mates too, as we could be grabbing them to heal them\r
+                               W_Grabber_UpdateStats(self.owner, FALSE, TRUE); // count this as a hit\r
+                       }\r
+\r
                        SetMovetypeFollow(self, other);\r
-                       W_Grabber_UpdateStats(self.owner, FALSE, TRUE); // count this as a hit\r
                        WarpZone_RefSys_BeginAddingIncrementally(self, self.aiment);\r
                }\r
 \r