From c782c938eed587cc6edc9684405ceffcd8eab00c Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 15:59:01 +0200 Subject: [PATCH] Use different means of removing consumable items from predators when they disconnect, spectate, or respawn --- data/qcsrc/server/cl_client.qc | 14 ++++++++++++++ data/qcsrc/server/t_items.qc | 7 ------- 2 files changed, 14 insertions(+), 7 deletions(-) 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 -- 2.39.2