Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Fixed issue where movepath is updated too early, causing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Dec 29, 2023
1 parent 2d7ddfd commit 0c5aaf5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions Entities/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@ int Actor::Create(const Actor &reference)
m_pMOMoveTarget = reference.m_pMOMoveTarget;
m_PrevPathTarget = reference.m_PrevPathTarget;
m_MoveVector = reference.m_MoveVector;
if (!m_Waypoints.empty()) {
UpdateMovePath();
}
// m_MovePath.clear(); will recalc on its own
m_MovePath.clear();
m_UpdateMovePath = reference.m_UpdateMovePath;
m_MoveProximityLimit = reference.m_MoveProximityLimit;
m_AIBaseDigStrength = reference.m_AIBaseDigStrength;
Expand Down
2 changes: 0 additions & 2 deletions Managers/SceneMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ int SceneMan::LoadScene(Scene *pNewScene, bool placeObjects, bool placeUnits) {
g_PostProcessMan.ClearScenePostEffects();

if (m_pCurrentScene) {
// Ensure all async pathing requests are complete
m_pCurrentScene->BlockUntilAllPathingRequestsComplete();
delete m_pCurrentScene;
m_pCurrentScene = nullptr;
}
Expand Down

0 comments on commit 0c5aaf5

Please sign in to comment.