Skip to content

Commit f0dfc73

Browse files
committed
Make sure spawns which get CreateObject1 and CreateObject2 are flagged as CreateObject2 and get orientation overridden
1 parent b4dac9e commit f0dfc73

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

WowPacketParser/Parsing/Parsers/UpdateHandler.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ public static void ProcessExistingObject(ref WoWObject obj, WoWObject newObj, Wo
145145
obj.EntityFragments = newObj.EntityFragments;
146146
if (guid.GetHighType() == HighGuidType.Creature) // skip if not an unit
147147
{
148+
// sometimes CreateObject2 is sent after CreateObject1 for the same guid
149+
// in those cases orientation of CreateObject1 is 0, so we force the 2nd orientation
150+
if (newObj.CreateType == CreateObjectType.Spawn && obj.Movement.Position.Equals(newObj.Movement.Position))
151+
{
152+
obj.CreateType = CreateObjectType.Spawn;
153+
obj.Movement.Orientation = newObj.Movement.Orientation;
154+
}
155+
148156
if (!obj.Movement.HasWpsOrRandMov)
149157
if (obj.Movement.Position != newObj.Movement.Position)
150158
if (((obj as Unit).UnitData.Flags & (uint) UnitFlags.IsInCombat) == 0) // movement could be because of aggro so ignore that

0 commit comments

Comments
 (0)