feat(Core/Movement): Allow waypoints to use 0 as valid facing value (#11681)

* feat(Core/Movement): Allow waypoints to use 0 as valid facing value

* cherry-pick commit (https://github.com/TrinityCore/TrinityCore/commit/4747515872775553de35cc3267e1ccd5e0076ca4)

Co-Authored-By: Ovah <[email protected]>

* Update SmartScriptMgr.h

* a

* Update SmartAI.cpp

* Update SmartAI.cpp

* Update SmartAI.cpp

* typo

* Update SmartAI.cpp

* Update SmartAI.cpp

* Compile fix

* compile #2

* Update WaypointMgr.h

* Update SmartScriptMgr.h

* compile fix again

Co-authored-by: Ovah <[email protected]>
Co-authored-by: MDIC <[email protected]>
This commit is contained in:
Kitzunu
2022-05-21 23:42:41 +02:00
committed by GitHub
co-authored by Ovah MDIC
parent 92cf37731a
commit 90fccacad5
7 changed files with 27 additions and 15 deletions
+2 -2
View File
@@ -257,9 +257,9 @@ void SmartAI::PausePath(uint32 delay, bool forced)
me->GetMotionMaster()->MoveIdle();//force stop
auto waypoint = mWayPoints->find(mCurrentWPID);
if (float orientation = waypoint->second->o)
if (waypoint->second->o.has_value())
{
me->SetFacingTo(orientation);
me->SetFacingTo(waypoint->second->o.has_value());
}
}
GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, nullptr, mCurrentWPID, GetScript()->GetPathId());