OK FrostfangSea and some other huge exceptions for NPCs, restrict the attackable flag to bot, client and their pets
This commit is contained in:
parent
3a256b21cc
commit
72a43fdbb4
1 changed files with 4 additions and 5 deletions
|
@ -96,11 +96,6 @@ bool Entity::AttackAllowed(Entity* target, float distance, bool range_attack) {
|
|||
LogWrite(COMBAT__DEBUG, 3, "AttackAllowed", "Failed to attack: no target, mezzed, stunned or dazed");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!target->IsPlayer() && !target->GetAttackable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsPlayer())
|
||||
client = ((Player*)this)->GetClient();
|
||||
|
||||
|
@ -111,6 +106,10 @@ bool Entity::AttackAllowed(Entity* target, float distance, bool range_attack) {
|
|||
target = ((NPC*)target)->GetOwner();
|
||||
}
|
||||
|
||||
if((IsBot() || (client || (attacker && (attacker->IsPlayer() || attacker->IsBot())))) && !target->IsPlayer() && !target->GetAttackable()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (attacker == target) {
|
||||
LogWrite(COMBAT__DEBUG, 3, "AttackAllowed", "Failed to attack: attacker tried to attack himself or his pet.");
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue