From 20eabe1aa7fc6cf9361b7e0ac84c3c5b830c2db9 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 19 Nov 2011 15:25:53 +0200 Subject: [PATCH] Allow dropped food to be picked back up by anyone. Yes, my game is going to be that nasty >:) --- data/qcsrc/server/t_items.qc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/data/qcsrc/server/t_items.qc b/data/qcsrc/server/t_items.qc index 1d111d01..a600ddd4 100644 --- a/data/qcsrc/server/t_items.qc +++ b/data/qcsrc/server/t_items.qc @@ -321,6 +321,20 @@ void Item_Consumable_Spawn(entity e, entity pl) Vore_AutoDigest(pl); } +void Item_DroppedConsumable_Touch() +{ + if(time < self.cnt) + return; + + // give the consumable item to the player touching it + if(other.stomach_load + self.dmg <= other.stomach_maxload) + { + Item_Consumable_Spawn(self, other); + remove(self); + self = world; + } +} + void Item_DroppedConsumable_Spawn(entity e) { entity item; @@ -342,6 +356,8 @@ void Item_DroppedConsumable_Spawn(entity e) item.velocity = v_forward * cvar("g_balance_vore_regurgitate_force"); e.predator.velocity += -v_forward * cvar("g_balance_vore_regurgitate_predatorforce"); + item.touch = Item_DroppedConsumable_Touch; + item.cnt = time + 1; // 1 second delay SUB_SetFade(item, time + 20, 1); } -- 2.39.2