From 3000a130262803bbf553d91954a2f53591fd17f4 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 12 Feb 2016 01:40:51 -0500 Subject: [PATCH] v0.3.4a: added a safety check for null ripples --- .../levels/SewerLevel.java | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java index f3b846124..59db3cf90 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/SewerLevel.java @@ -20,18 +20,26 @@ */ package com.shatteredpixel.shatteredpixeldungeon.levels; -import com.shatteredpixel.shatteredpixeldungeon.levels.traps.*; -import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; -import com.watabou.noosa.Game; -import com.watabou.noosa.Group; -import com.watabou.noosa.particles.Emitter; -import com.watabou.noosa.particles.PixelParticle; import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost; +import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple; import com.shatteredpixel.shatteredpixeldungeon.items.DewVial; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.AlarmTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ChillingTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.FlockTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.OozeTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.SummoningTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.TeleportationTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ToxicTrap; +import com.shatteredpixel.shatteredpixeldungeon.levels.traps.WornTrap; +import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; +import com.watabou.noosa.Game; +import com.watabou.noosa.Group; +import com.watabou.noosa.particles.Emitter; +import com.watabou.noosa.particles.PixelParticle; import com.watabou.utils.ColorMath; import com.watabou.utils.PointF; import com.watabou.utils.Random; @@ -208,8 +216,11 @@ public class SewerLevel extends RegularLevel { super.update(); if ((rippleDelay -= Game.elapsed) <= 0) { - GameScene.ripple( pos + WIDTH ).y -= DungeonTilemap.SIZE / 2; - rippleDelay = Random.Float( 0.2f, 0.3f ); + Ripple ripple = GameScene.ripple( pos + WIDTH ); + if (ripple != null) { + ripple.y -= DungeonTilemap.SIZE / 2; + rippleDelay = Random.Float(0.2f, 0.3f); + } } } }