diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-01-28 16:45:55 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-01-28 16:45:55 -0500 |
commit | 7171798052557dab8b3e6febfc027bf5b1b52941 (patch) | |
tree | d22dbab17de7b84614b364ea916ca123a6fd41b2 /src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove | |
parent | 8f46c097bf0b3cf314af62a66428e04043d0a61f (diff) | |
download | fourpuzzle-7171798052557dab8b3e6febfc027bf5b1b52941.tar.gz fourpuzzle-7171798052557dab8b3e6febfc027bf5b1b52941.tar.bz2 fourpuzzle-7171798052557dab8b3e6febfc027bf5b1b52941.zip |
Fixed off-screen bug
If an Event is adjacent to a Map boundary, then it could accidentally walk off the screen during the following circumstance: When a MoveEvent() action tells said Event to move off-screen while the Event is already moving, collision checking will be bypassed and the Event will proceed to walk off the screen, after which an Exception will be thrown when said Event attempts to move again. This bug has been fixed.
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove')
-rw-r--r-- | src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java index 74affc4..2f55816 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/specialmove/StepMoveEvent.java | |||
@@ -24,14 +24,15 @@ public class StepMoveEvent implements MoveEvent { | |||
24 | 24 | ||
25 | public void doAction(Event ev) | 25 | public void doAction(Event ev) |
26 | { | 26 | { |
27 | ev.startMoving(direction); | 27 | if (ev.startMoving(direction)) |
28 | |||
29 | while (ev.isMoving()) | ||
30 | { | 28 | { |
31 | try { | 29 | while (ev.isMoving()) |
32 | Thread.sleep(2); | 30 | { |
33 | } catch (InterruptedException ex) { | 31 | try { |
34 | Logger.getLogger(StepMoveEvent.class.getName()).log(Level.SEVERE, null, ex); | 32 | Thread.sleep(2); |
33 | } catch (InterruptedException ex) { | ||
34 | Logger.getLogger(StepMoveEvent.class.getName()).log(Level.SEVERE, null, ex); | ||
35 | } | ||
35 | } | 36 | } |
36 | } | 37 | } |
37 | } | 38 | } |