From 4e3939869ace987e9cfdc9c8fb5bea19abb96e80 Mon Sep 17 00:00:00 2001 From: madratman Date: Wed, 6 Nov 2019 10:32:19 -0800 Subject: [PATCH] fix simContinueForTime with updated simPause --- .../AirSim/Source/SimMode/SimModeWorldBase.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp index 4c44a3c3cd..d3c96e5df7 100644 --- a/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp +++ b/Unreal/Plugins/AirSim/Source/SimMode/SimModeWorldBase.cpp @@ -84,7 +84,18 @@ void ASimModeWorldBase::pause(bool is_paused) void ASimModeWorldBase::continueForTime(double seconds) { + if(physics_world_->isPaused()) + { + physics_world_->pause(false); + UGameplayStatics::SetGamePaused(this->GetWorld(), false); + } + physics_world_->continueForTime(seconds); + while(!physics_world_->isPaused()) + { + continue; + } + UGameplayStatics::SetGamePaused(this->GetWorld(), true); } void ASimModeWorldBase::updateDebugReport(msr::airlib::StateReporterWrapper& debug_reporter)