--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-30 16:31:05 -05:00
8 changed files with 67 additions and 51 deletions

View File

@@ -49,7 +49,7 @@ void WorldSession::HandleAttackSwingOpcode( WorldPacket & recv_data )
return;
}
if(_player->IsFriendlyTo(pEnemy) || pEnemy->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
if(!_player->canAttack(pEnemy))
{
sLog.outError( "WORLD: Enemy %s %u is friendly",(IS_PLAYER_GUID(guid) ? "player" : "creature"),GUID_LOPART(guid));
@@ -58,14 +58,6 @@ void WorldSession::HandleAttackSwingOpcode( WorldPacket & recv_data )
return;
}
if(!pEnemy->isAlive())
{
// client can generate swing to known dead target if autoswitch between autoshot and autohit is enabled in client options
// stop attack state at client
SendAttackStop(pEnemy);
return;
}
_player->Attack(pEnemy,true);
}