From 351ce1525f570a52d571d1da720ae4f6a5815a22 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 5 Aug 2012 14:03:54 +0100 Subject: [PATCH] Update gravity walls, fixes issue #52 --- src/simulation/Simulation.cpp | 15 +++++++++++++-- src/simulation/Simulation.h | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 59ff5d11c..8717faa54 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -114,7 +114,7 @@ int Simulation::Load(int fullX, int fullY, GameSave * save) } } - grav->gravity_mask(); + gravWallChanged = true; return 0; } @@ -232,6 +232,8 @@ void Simulation::clear_area(int area_x, int area_y, int area_w, int area_h) { for (cx=0; cxgravy; gravp = grav->gravp; gravmap = grav->gravmap; + + if(gravWallChanged) + { + grav->gravity_mask(); + gravWallChanged = false; + } } } diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 31a0a075b..e4f43111d 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -62,7 +62,7 @@ public: playerst fighters[256]; //255 is the maximum number of fighters unsigned char fighcount; //Contains the number of fighters int lighting_recreate; - int gravwl_timeout; + bool gravWallChanged; Particle portalp[CHANNELS][8][80]; Particle emptyparticle; int portal_rx[8];