Merge commit 'origin/master' into 310

This commit is contained in:
VladimirMangos 2009-05-23 01:55:33 +04:00
commit f72a8bc6dc
21 changed files with 161 additions and 62 deletions

View file

@ -2079,6 +2079,11 @@ void Player::SetGameMaster(bool on)
pet->getHostilRefManager().setOnlineOfflineState(false);
}
for (int8 i = 0; i < MAX_TOTEM; ++i)
if(m_TotemSlot[i])
if(Creature *totem = GetMap()->GetCreature(m_TotemSlot[i]))
totem->setFaction(35);
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
ResetContestedPvP();
@ -2103,6 +2108,11 @@ void Player::SetGameMaster(bool on)
pet->getHostilRefManager().setOnlineOfflineState(true);
}
for (int8 i = 0; i < MAX_TOTEM; ++i)
if(m_TotemSlot[i])
if(Creature *totem = GetMap()->GetCreature(m_TotemSlot[i]))
totem->setFaction(getFaction());
// restore FFA PvP Server state
if(sWorld.IsFFAPvPRealm())
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
@ -17311,11 +17321,6 @@ void Player::UpdatePvP(bool state, bool ovrride)
if(!state || ovrride)
{
SetPvP(state);
if(Pet* pet = GetPet())
pet->SetPvP(state);
if(Unit* charmed = GetCharm())
charmed->SetPvP(state);
pvpInfo.endTimer = 0;
}
else
@ -17323,14 +17328,7 @@ void Player::UpdatePvP(bool state, bool ovrride)
if(pvpInfo.endTimer != 0)
pvpInfo.endTimer = time(NULL);
else
{
SetPvP(state);
if(Pet* pet = GetPet())
pet->SetPvP(state);
if(Unit* charmed = GetCharm())
charmed->SetPvP(state);
}
}
}