diff --git a/source/EngineGpuKernels/ConstructorProcessor.cuh b/source/EngineGpuKernels/ConstructorProcessor.cuh index 21838be30..62828f183 100644 --- a/source/EngineGpuKernels/ConstructorProcessor.cuh +++ b/source/EngineGpuKernels/ConstructorProcessor.cuh @@ -651,7 +651,7 @@ ConstructorProcessor::constructCellIntern( result->inputExecutionOrderNumber = constructionData.inputExecutionOrderNumber; result->outputBlocked = constructionData.outputBlocked; - result->activationTime = OffspringActivationTime; + result->activationTime = 0; result->genomeComplexity = hostCell->genomeComplexity; auto genomeCurrentBytePosition = constructionData.genomeCurrentBytePosition; diff --git a/source/EngineInterface/CellFunctionConstants.h b/source/EngineInterface/CellFunctionConstants.h index a3ae67843..ed87bba44 100644 --- a/source/EngineInterface/CellFunctionConstants.h +++ b/source/EngineInterface/CellFunctionConstants.h @@ -177,5 +177,3 @@ enum ActivityOrigin_ ActivityOrigin_Unknown, ActivityOrigin_Sensor }; - -auto constexpr OffspringActivationTime = 5; \ No newline at end of file diff --git a/source/Gui/AutosaveWindow.cpp b/source/Gui/AutosaveWindow.cpp index 40b15e109..ad8a5d2c5 100644 --- a/source/Gui/AutosaveWindow.cpp +++ b/source/Gui/AutosaveWindow.cpp @@ -345,9 +345,6 @@ void AutosaveWindow::onDeleteSavepoint(SavepointEntry const& entry) void AutosaveWindow::onLoadSavepoint(SavepointEntry const& entry) { FileTransferController::get().onOpenSimulation(entry->filename); - if (_autosaveEnabled) { - _lastAutosaveTimepoint = std::chrono::steady_clock::now(); - } } void AutosaveWindow::processCleanup() @@ -367,6 +364,11 @@ void AutosaveWindow::processAutomaticSavepoints() return; } + if (!_lastSessionId.has_value() || _lastSessionId.value() != _simulationFacade->getSessionId()) { + _lastAutosaveTimepoint = std::chrono::steady_clock::now(); + _lastSessionId = _simulationFacade->getSessionId(); + } + auto minSinceLastAutosave = std::chrono::duration_cast(std::chrono::steady_clock::now() - _lastAutosaveTimepoint).count(); if (minSinceLastAutosave >= _autosaveInterval && _savepointTable.has_value()) { onCreateSavepoint(_catchPeaks != CatchPeaks_None); diff --git a/source/Gui/AutosaveWindow.h b/source/Gui/AutosaveWindow.h index 64a4f7af0..34ab8beb8 100644 --- a/source/Gui/AutosaveWindow.h +++ b/source/Gui/AutosaveWindow.h @@ -86,4 +86,5 @@ class AutosaveWindow : public AlienWindow std::chrono::steady_clock::time_point _lastPeakTimepoint; TaskProcessor _peakProcessor; SharedDeserializedSimulation _peakDeserializedSimulation; + std::optional _lastSessionId; };