DEADSOFTWARE

Add fluid update range restriction
[cavedroid.git] / core / src / ru / deadsoftware / cavedroid / game / world / GameWorldFluidsLogicControllerTask.java
index ed6b1ec634d70cc880ddb81f9d28897eaf811f16..99d1a046b51605b9e8570e408e69b4eb5105cbe8 100644 (file)
@@ -167,7 +167,7 @@ public class GameWorldFluidsLogicControllerTask extends Timer.Task {
     private void fluidUpdater() {
         int midScreen = (int) mMobsController.getPlayer().x / 16;
         for (int y = mGameWorld.getHeight() - 1; y >= 0; y--) {
-            for (int x = 0; x <= mGameWorld.getWidth() / 2; x++) {
+            for (int x = 0; x <= Math.min(mGameWorld.getWidth() / 2, 32); x++) {
                 updateFluids(midScreen + x, y);
                 updateFluids(midScreen - x, y);
             }