]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Use different means of removing consumable items from predators when they disconnect...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 13:59:01 +0000 (15:59 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 19 Nov 2011 13:59:01 +0000 (15:59 +0200)
data/qcsrc/server/cl_client.qc
data/qcsrc/server/t_items.qc

index 51d03fcb5235183023b7e22508b658e6b4da74ec..29d6582c69821fe3b0c002ca70513159b02d1262 100644 (file)
@@ -581,6 +581,13 @@ void PutObserverInServer (void)
        }\r
 \r
        Vore_Disconnect();\r
+       entity e;\r
+       for(e = world; (e = find(e, classname, "consumable")); )\r
+       {\r
+               // remove consumable items when we spectate\r
+               if(e.predator == self)\r
+                       Item_Consumable_Remove(e, TRUE);\r
+       }\r
 \r
        kh_Key_DropAll(self, TRUE);\r
 \r
@@ -1626,6 +1633,13 @@ void ClientDisconnect (void)
        }\r
 \r
        Vore_Disconnect();\r
+       entity e;\r
+       for(e = world; (e = find(e, classname, "consumable")); )\r
+       {\r
+               // remove consumable items when we disconnect\r
+               if(e.predator == self)\r
+                       Item_Consumable_Remove(e, TRUE);\r
+       }\r
 \r
        CheatShutdownClient();\r
 \r
index a600ddd447cc948a8cb69cf2a1d130273a5aa60d..e634c4bc7a8524331b4ec438b0c0185ee954d44c 100644 (file)
@@ -229,13 +229,6 @@ void Item_Consumable_Think()
                Item_Consumable_Remove(self, TRUE);\r
                return;\r
        }\r
-\r
-       if(self.predator.classname != "player")\r
-       {\r
-               // no longer a player, remove consumable items\r
-               Item_Consumable_Remove(self, TRUE);\r
-               return;\r
-       }\r
        if(self.predator.stat_eaten)\r
        {\r
                // prey can't hold consumable items\r