summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaveliy Skresanov <savask@yandex.ru>2013-07-09 16:39:48 (GMT)
committer Saveliy Skresanov <savask@yandex.ru>2013-07-09 16:39:48 (GMT)
commit6e7a5488b561aee4f3b5e3b22ff1b7851c3921ef (patch)
tree00523c047f811c8e285a84b8dfc246340f34df3d
parent3c5a341dbc0107fbed19a96e997711a588b80478 (diff)
downloadpowder-6e7a5488b561aee4f3b5e3b22ff1b7851c3921ef.zip
powder-6e7a5488b561aee4f3b5e3b22ff1b7851c3921ef.tar.gz
Fixed the bug with SPWN not creating when redoing (Ctrl-Z).
-rw-r--r--src/simulation/Simulation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index e45f5a8..5d40529 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -307,6 +307,10 @@ Snapshot * Simulation::CreateSnapshot()
void Simulation::Restore(const Snapshot & snap)
{
parts_lastActiveIndex = NPART-1;
+
+ for(int i; i<NPART; i++)
+ elementCount[i] = 0;
+
std::copy(snap.AirPressure.begin(), snap.AirPressure.end(), &pv[0][0]);
std::copy(snap.AirVelocityX.begin(), snap.AirVelocityX.end(), &vx[0][0]);
std::copy(snap.AirVelocityY.begin(), snap.AirVelocityY.end(), &vy[0][0]);