Core/Misc: Now attackers receiving all rewards, when the victim gone offline.

This commit is contained in:
Dimitro
2012-10-03 14:13:14 +03:00
parent 93a78d9bb5
commit c299e8340c

View File

@@ -423,10 +423,6 @@ void WorldSession::LogoutPlayer(bool Save)
}
else if (!_player->getAttackers().empty())
{
_player->CombatStop();
_player->getHostileRefManager().setOnlineOfflineState(false);
_player->RemoveAllAurasOnDeath();
// build set of player who attack _player or who have pet attacking of _player
std::set<Player*> aset;
for (Unit::AttackerSet::const_iterator itr = _player->getAttackers().begin(); itr != _player->getAttackers().end(); ++itr)
@@ -438,6 +434,11 @@ void WorldSession::LogoutPlayer(bool Save)
aset.insert((Player*)(*itr));
}
// CombatStop() method is removing all attackers from the AttackerSet
// That is why it must be AFTER building current set of attackers
_player->CombatStop();
_player->getHostileRefManager().setOnlineOfflineState(false);
_player->RemoveAllAurasOnDeath();
_player->SetPvPDeath(!aset.empty());
_player->KillPlayer();
_player->BuildPlayerRepop();