From: MirceaKitsune Date: Sat, 19 Nov 2011 13:59:01 +0000 (+0200) Subject: Use different means of removing consumable items from predators when they disconnect... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c782c938eed587cc6edc9684405ceffcd8eab00c;p=voretournament%2Fvoretournament.git Use different means of removing consumable items from predators when they disconnect, spectate, or respawn --- diff --git a/data/qcsrc/server/cl_client.qc b/data/qcsrc/server/cl_client.qc index 51d03fcb..29d6582c 100644 --- a/data/qcsrc/server/cl_client.qc +++ b/data/qcsrc/server/cl_client.qc @@ -581,6 +581,13 @@ void PutObserverInServer (void) } Vore_Disconnect(); + entity e; + for(e = world; (e = find(e, classname, "consumable")); ) + { + // remove consumable items when we spectate + if(e.predator == self) + Item_Consumable_Remove(e, TRUE); + } kh_Key_DropAll(self, TRUE); @@ -1626,6 +1633,13 @@ void ClientDisconnect (void) } Vore_Disconnect(); + entity e; + for(e = world; (e = find(e, classname, "consumable")); ) + { + // remove consumable items when we disconnect + if(e.predator == self) + Item_Consumable_Remove(e, TRUE); + } CheatShutdownClient(); diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index a600ddd4..e634c4bc 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -229,13 +229,6 @@ void Item_Consumable_Think() Item_Consumable_Remove(self, TRUE); return; } - - if(self.predator.classname != "player") - { - // no longer a player, remove consumable items - Item_Consumable_Remove(self, TRUE); - return; - } if(self.predator.stat_eaten) { // prey can't hold consumable items