From c57ebb8367a3e9f8d4bd216498cebed32b485332 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 7 Jan 2016 07:10:48 +0000 Subject: [PATCH] Make previous changes work with NSM, closes #341 --- source/carla_host.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/carla_host.py b/source/carla_host.py index 58770fb3f..c8260cb5b 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -509,6 +509,8 @@ class HostWindow(QMainWindow): def loadProjectNow(self): if not self.fProjectFilename: return qCritical("ERROR: loading project without filename set") + if self.host.nsmOK and not os.path.exists(self.fProjectFilename): + return self.projectLoadingStarted() self.fIsProjectLoading = True @@ -652,16 +654,19 @@ class HostWindow(QMainWindow): def engineStopFinal(self): self.killTimers() self.removeAllPlugins() - self.host.remove_all_plugins() - if self.host.is_engine_running() and not self.host.engine_close(): - print(self.host.get_last_error()) + if self.host.is_engine_running(): + self.host.remove_all_plugins() + + if not self.host.engine_close(): + print(self.host.get_last_error()) if self.fCustomStopAction == 1: self.close() elif self.fCustomStopAction == 2: self.slot_engineStart() self.loadProjectNow() + self.host.nsm_ready(2) # open self.fCustomStopAction = 0 @@ -1711,11 +1716,8 @@ class HostWindow(QMainWindow): self.setProperWindowTitle() self.fCustomStopAction = 2 - if not self.slot_engineStop(True): - return - - self.slot_engineStart() - self.loadProjectNow() + self.slot_engineStop(True) + return # Save elif value1 == 3: