mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
Change destroyable component validator to properly check friends
This commit is contained in:
parent
d78b2404e2
commit
a19454f7ae
@ -532,12 +532,12 @@ bool DestroyableComponent::CheckValidity(const LWOOBJID target, const bool ignor
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get if the target entity is an enemy
|
// Get if the target entity is an enemy and friend
|
||||||
bool isEnemy = IsEnemy(targetEntity);
|
bool isEnemy = IsEnemy(targetEntity);
|
||||||
|
bool isFriend = IsFriend(targetEntity);
|
||||||
|
|
||||||
// Return true if the target type matches what we are targeting
|
// Return true if the target type matches what we are targeting
|
||||||
// Friends are entities who are not enemies
|
return (isEnemy && targetEnemy) || (isFriend && targetFriend);
|
||||||
return (isEnemy && targetEnemy) || (!isEnemy && targetFriend);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user