|
@@ -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;
|