From 986173af4c1aec6308ea6f6f2e126b65eeaf37a3 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 7 Jan 2013 17:54:10 -0500 Subject: [PATCH] save signs in snapshots --- src/simulation/Simulation.cpp | 2 ++ src/simulation/Snapshot.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index dbbedfc79..795640915 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -293,6 +293,7 @@ Snapshot * Simulation::CreateSnapshot() snap->stickmen.push_back(player2); snap->stickmen.push_back(player); snap->stickmen.insert(snap->stickmen.begin(), &fighters[0], &fighters[255]); + snap->signs = signs; return snap; } @@ -317,6 +318,7 @@ void Simulation::Restore(const Snapshot & snap) std::copy(snap.stickmen.begin(), snap.stickmen.end()-2, &fighters[0]); player = snap.stickmen[snap.stickmen.size()-1]; player2 = snap.stickmen[snap.stickmen.size()-2]; + signs = snap.signs; } /*int Simulation::Load(unsigned char * data, int dataLength) diff --git a/src/simulation/Snapshot.h b/src/simulation/Snapshot.h index 983bdf3cb..d87f4d9e6 100644 --- a/src/simulation/Snapshot.h +++ b/src/simulation/Snapshot.h @@ -29,6 +29,7 @@ public: std::vector FanVelocityY; std::vector stickmen; + std::vector signs; Snapshot() : AirPressure(), @@ -46,7 +47,8 @@ public: ElecMap(), FanVelocityX(), FanVelocityY(), - stickmen() + stickmen(), + signs() { }