Skip to content

Commit

Permalink
fix: Implement EndSpline which removes moveflags and calls _Finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
obi23lipnik authored and killerwife committed Dec 17, 2023
1 parent 40962a6 commit 46ce862
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4647,7 +4647,7 @@ void Unit::SetFacingTo(float ori)
init.Launch();
// orientation change is in-place
UpdateSplinePosition();
DisableSpline();
EndSpline();
}

void Unit::SetFacingToObject(WorldObject* object)
Expand All @@ -4661,7 +4661,7 @@ void Unit::SetFacingToObject(WorldObject* object)
init.Launch();
// orientation change is in-place
UpdateSplinePosition();
DisableSpline();
EndSpline();
}

bool Unit::isInAccessablePlaceFor(Unit const* unit) const
Expand Down Expand Up @@ -11519,6 +11519,12 @@ void Unit::DisableSpline()
movespline->_Interrupt();
}

void Unit::EndSpline()
{
m_movementInfo.RemoveMovementFlag(MovementFlags(MOVEFLAG_SPLINE_ENABLED | MOVEFLAG_FORWARD));
movespline->_Finalize();
}

// This will create a new creature and set the current unit as the controller of that new creature
Unit* Unit::TakePossessOf(SpellEntry const* spellEntry, SummonPropertiesEntry const* /*summonProp*/, uint32 effIdx, float x, float y, float z, float ang)
{
Expand Down
1 change: 1 addition & 0 deletions src/game/Entities/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -2568,6 +2568,7 @@ class Unit : public WorldObject
bool m_canDualWield = false;

void DisableSpline();
void EndSpline();
bool m_isCreatureLinkingTrigger;
bool m_isSpawningLinked;

Expand Down

0 comments on commit 46ce862

Please sign in to comment.