Fixed the bug with SPWN not creating when redoing (Ctrl-Z).

This commit is contained in:
Saveliy Skresanov 2013-07-09 23:39:48 +07:00
parent 3c5a341dbc
commit 6e7a5488b5

View File

@ -307,6 +307,10 @@ Snapshot * Simulation::CreateSnapshot()
void Simulation::Restore(const Snapshot & snap) void Simulation::Restore(const Snapshot & snap)
{ {
parts_lastActiveIndex = NPART-1; 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.AirPressure.begin(), snap.AirPressure.end(), &pv[0][0]);
std::copy(snap.AirVelocityX.begin(), snap.AirVelocityX.end(), &vx[0][0]); std::copy(snap.AirVelocityX.begin(), snap.AirVelocityX.end(), &vx[0][0]);
std::copy(snap.AirVelocityY.begin(), snap.AirVelocityY.end(), &vy[0][0]); std::copy(snap.AirVelocityY.begin(), snap.AirVelocityY.end(), &vy[0][0]);