diff --git a/source/src/entities.cpp b/source/src/entities.cpp index 040ab779..964588d8 100644 --- a/source/src/entities.cpp +++ b/source/src/entities.cpp @@ -290,7 +290,42 @@ void pickupeffects(int n, playerent *d) if(d!=player1 && d->type!=ENT_BOT) return; if(&is) { - if(d==player1) audiomgr.playsoundc(is.sound); + if(d==player1) + { + audiomgr.playsoundc(is.sound); + + /* + onPickup arg1 legend: + 0 = pistol clips + 1 = ammo box + 2 = grenade + 3 = health pack + 4 = helmet + 5 = armour + 6 = akimbo + */ + if(identexists("onPickup")) + { + string o; + itemstat tmp; + switch(e.type) + { + case I_CLIPS: tmp = ammostats[GUN_PISTOL]; break; + case I_AMMO: tmp = ammostats[player1->primary]; break; + case I_GRENADE: tmp = ammostats[GUN_GRENADE]; break; + case I_AKIMBO: tmp = ammostats[GUN_AKIMBO]; break; + case I_HEALTH: + case I_HELMET: + case I_ARMOUR: tmp = powerupstats[e.type-I_HEALTH]; break; + default: break; + } + if(m_lss && e.type == I_GRENADE) + formatstring(o)("onPickup %d %d", e.type - 3, 2); + else + formatstring(o)("onPickup %d %d", e.type - 3, tmp); + execute(o); + } + } else audiomgr.playsound(is.sound, d); }