fix stewblaster stopping for non-players (#1521)

fixes an issue when stew blaster would stop for non-players and would stand still permanently due to enemy hitboxes being removed.  Tested that stewblaster only stops for players and starts moving when there are no players in the vicinity
This commit is contained in:
David Markowitz
2024-03-30 06:17:56 -07:00
committed by GitHub
parent 150031861d
commit 5996f3cbf4
2 changed files with 13 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ void MovementAIComponent::SetPath(const std::string pathName) {
}
void MovementAIComponent::Pause() {
if (m_Paused) return;
m_Paused = true;
SetPosition(ApproximateLocation());
m_SavedVelocity = GetVelocity();
@@ -76,6 +77,7 @@ void MovementAIComponent::Pause() {
}
void MovementAIComponent::Resume() {
if (!m_Paused) return;
m_Paused = false;
SetVelocity(m_SavedVelocity);
m_SavedVelocity = NiPoint3Constant::ZERO;