Fixed Unknown pet names.

Fixed Pet's not having a valid position.
This commit is contained in:
hondacrx
2017-07-05 12:11:54 -04:00
parent c2847a7278
commit 50297a11bc
2 changed files with 13 additions and 3 deletions
+10 -1
View File
@@ -178,9 +178,9 @@ namespace Game.Entities
SetFaction(owner.getFaction());
SetUInt32Value(UnitFields.CreatedBySpell, summonSpellId);
float px, py, pz;
if (IsCritter())
{
float px, py, pz;
owner.GetClosePoint(out px, out py, out pz, GetObjectSize(), SharedConst.PetFollowDist, GetFollowAngle());
Relocate(px, py, pz, owner.GetOrientation());
@@ -234,6 +234,15 @@ namespace Game.Entities
SynchronizeLevelWithOwner();
// Set pet's position after setting level, its size depends on it
owner.GetClosePoint(out px, out py, out pz, GetObjectSize(), SharedConst.PetFollowDist, GetFollowAngle());
Relocate(px, py, pz, owner.GetOrientation());
if (!IsPositionValid())
{
Log.outError(LogFilter.Pet, "Pet ({0}, entry {1}) not loaded. Suggested coordinates isn't valid (X: {2} Y: {3})", GetGUID().ToString(), GetEntry(), GetPositionX(), GetPositionY());
return false;
}
SetReactState((ReactStates)result.Read<byte>(6));
SetCanModifyStats(true);