From: MirceaKitsune Date: Sat, 19 Nov 2011 13:25:53 +0000 (+0200) Subject: Allow dropped food to be picked back up by anyone. Yes, my game is going to be that... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=20eabe1aa7fc6cf9361b7e0ac84c3c5b830c2db9;p=voretournament%2Fvoretournament.git Allow dropped food to be picked back up by anyone. Yes, my game is going to be that nasty >:) --- 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); }