diff --git a/src/core/thread.c b/src/core/thread.c index f17b5e30a..3a0c802ea 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -158,7 +158,6 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) { }; core->addCoreCallbacks(core, &callbacks); core->setSync(core, &threadContext->impl->sync); - core->reset(core); struct mLogFilter filter; if (!threadContext->logger.d.filter) { @@ -168,12 +167,13 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) { } mCoreThreadRewindParamsChanged(threadContext); - - _changeState(threadContext->impl, THREAD_RUNNING, true); - if (threadContext->startCallback) { threadContext->startCallback(threadContext); } + + core->reset(core); + _changeState(threadContext->impl, THREAD_RUNNING, true); + if (threadContext->resetCallback) { threadContext->resetCallback(threadContext); } diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index 108fafed9..1372c48f8 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -66,10 +66,6 @@ CoreController::CoreController(mCore* core, QObject* parent) controller->m_override->apply(context->core); } - if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) { - mCoreDeleteState(context->core, 0); - } - if (controller->m_multiplayer) { controller->m_multiplayer->attachGame(controller); } @@ -82,6 +78,11 @@ CoreController::CoreController(mCore* core, QObject* parent) for (auto action : controller->m_resetActions) { action(); } + + if (mCoreLoadState(context->core, 0, controller->m_loadStateFlags)) { + mCoreDeleteState(context->core, 0); + } + controller->m_resetActions.clear(); QSize size = controller->screenDimensions();