]> 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 e9b405f62c13ceb0f10429e8add751ae94dd421f..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
@@ -269,11 +269,11 @@ void GrabberTouch (void)
                                if(other.BUTTON_CHAT)\r
                                        self.owner.typehitsound += 1;\r
                                else\r
-                                       self.owner.hitsound += 1;\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