Fix a situation where nav could end up not being reset

This commit is contained in:
KimLS 2018-11-25 15:33:04 -08:00
parent 78adc7590e
commit db5c42735c

View File

@ -601,7 +601,13 @@ void MobMovementManager::NavigateTo(Mob *who, float x, float y, float z, MobMove
void MobMovementManager::StopNavigation(Mob *who) {
auto iter = _impl->Entries.find(who);
auto &ent = (*iter);
auto &nav = ent.second.NavTo;
nav.navigate_to_x = 0.0;
nav.navigate_to_y = 0.0;
nav.navigate_to_z = 0.0;
nav.navigate_to_heading = 0.0;
if (true == ent.second.Commands.empty()) {
PushStopMoving(ent.second);
return;