Skip to content

Commit

Permalink
fix resume simulation/reload in the middle of subframe debugging (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
krawthekrow authored and jacob1 committed Sep 5, 2016
1 parent 2df333c commit 8de12d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/game/GameController.h
@@ -1,4 +1,4 @@
#ifndef GAMECONTROLLER_H
#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H

#include <queue>
Expand Down
7 changes: 7 additions & 0 deletions src/gui/game/GameModel.cpp
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions src/simulation/Simulation.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 8de12d6

Please sign in to comment.