MUTATOR_HOOKFUNCTION(pb_ItemTouch)
{
+ entity p = other;
if(self.weapon)
if(other.piggybacker)
if(other.weapons & self.weapons)
{
- entity p = other;
+ p = other;
while(p.piggybacker)
{
p = p.piggybacker;
}
}
+ if(self.health || self.armorvalue)
+ if(other.piggybacker)
+ {
+ if(self.health)
+ if(other.health > start_health)
+ {
+ p = other;
+ while(p.piggybacker)
+ {
+ p = p.piggybacker;
+ if(p.health < start_health)
+ {
+ other = p;
+ break;
+ }
+ }
+ }
+
+ if(self.armorvalue)
+ if(other.armorvalue > 50) // can't use start value here, as players don't start with armor
+ {
+ p = other;
+ while(p.piggybacker)
+ {
+ p = p.piggybacker;
+ if(p.armorvalue < 50)
+ {
+ other = p;
+ break;
+ }
+ }
+ }
+ }
+
return false;
}