[7877] Correctly set totem PvP state at loading and owner PvP state change, including GM totem case.

* Also set PvP state in proper way at pet loading if owner in PvP state.
This commit is contained in:
VladimirMangos 2009-05-23 00:30:18 +04:00
parent e0e5ed7bd8
commit bc4611e8c0
6 changed files with 42 additions and 20 deletions

View file

@ -211,6 +211,9 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
sLog.outError("Pet have incorrect type (%u) for pet loading.", getPetType());
}
if(owner->IsPvP())
SetPvP(true);
InitStatsForLevel(petlevel);
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, fields[5].GetUInt32());