helper function IsAllied (counterpart to IsHostile, with NO_OWNER check)

heavy-resources
David Dormagen 2011-12-28 18:56:32 +01:00
parent 9be1e3beda
commit 980f953da4
1 changed files with 7 additions and 4 deletions

View File

@ -200,10 +200,6 @@ global func StonyObjectHit(int x, int y)
while(!GBackSolid(x*i, y*i) && i < average_obj_size) i++;
// To catch some high speed cases: if no solid found, check directly beneath
if (!GBackSolid(x*i, y*i))
{
x = 0;
y = 1;
i = 0;
while(!GBackSolid(x*i, y*i) && i < average_obj_size) i++;
}
// Check if digfree
@ -214,4 +210,11 @@ global func StonyObjectHit(int x, int y)
return Sound("SoftTouch?");
else
return Sound("SoftHit?");
}
global func IsAllied(int plr1, int plr2, bool check_one_way_only)
{
if(plr1 == NO_OWNER) return false;
if(plr2 == NO_OWNER) return false;
return !Hostile(plr1, plr2, check_one_way_only);
}