fix resume simulation/reload in the middle of subframe debugging (#330)

This commit is contained in:
Mark Theng 2016-09-05 09:33:33 +08:00 committed by jacob1
parent 2df333c99f
commit 8de12d616e
3 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,4 @@
#ifndef GAMECONTROLLER_H
#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H
#include <queue>

View File

@ -843,6 +843,13 @@ void GameModel::SetUser(User user)
void GameModel::SetPaused(bool pauseState)
{
if(!pauseState && sim->debug_currentParticle > 0)
{
sim->UpdateParticles(sim->debug_currentParticle, NPART);
sim->AfterSim();
sim->debug_currentParticle = 0;
}
sim->sys_pause = pauseState?1:0;
notifyPausedChanged();
}

View File

@ -1902,6 +1902,7 @@ void Simulation::create_arc(int sx, int sy, int dx, int dy, int midpoints, int v
void Simulation::clear_sim(void)
{
debug_currentParticle = 0;
emp_decor = 0;
emp_trigger_count = 0;
signs.clear();