improve the hitbox of the balloon for projectile targets

This prevents the one hanging on the balloon from shooting himself down with e.g. a bow.
objectmenu
Maikel de Vries 2016-01-24 20:23:02 +01:00
parent 93ba7c5954
commit d1d019ab09
1 changed files with 5 additions and 2 deletions

View File

@ -147,9 +147,12 @@ protected func OnUnmount(object clonk)
return;
}
public func IsProjectileTarget()
public func IsProjectileTarget(object projectile, object shooter)
{
return true;
// Exclude the bottom triangle edges from the hitbox such that projectiles can be shot while hanging on the balloon.
var dx = GetX() - projectile->GetX();
var dy = GetY() - projectile->GetY() + GetBottom();
return dy > Abs(dx);
}
public func OnProjectileHit(object projectile)