summary refs log tree commit diff stats
path: root/src/com
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-01-28 16:47:47 -0500
committerStarla Insigna <hatkirby@fourisland.com>2009-01-28 16:47:47 -0500
commitf5884d91e90e858b2672ef416071941fea786923 (patch)
tree5c7d16c51587e58f589bb6fada53d7099a8e16f5 /src/com
parent7171798052557dab8b3e6febfc027bf5b1b52941 (diff)
downloadfourpuzzle-f5884d91e90e858b2672ef416071941fea786923.tar.gz
fourpuzzle-f5884d91e90e858b2672ef416071941fea786923.tar.bz2
fourpuzzle-f5884d91e90e858b2672ef416071941fea786923.zip
Fixed HeroEvent rendering condition bug
Replaced said condition with an instanceof check to see if toDraw.getGraphic() is an instance of BlankEventGraphic. The previous way did not, in fact, work because an EventGraphic never be equal to a String. This previous way only existed because HeroEvent's graphic used to be stored as a filename/offset combo instead of as an EventGraphic.
Diffstat (limited to 'src/com')
-rw-r--r--src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java index 8b9e3fb..f39c451 100644 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/HeroEvent.java
@@ -13,6 +13,7 @@ import com.fourisland.fourpuzzle.Game;
13import com.fourisland.fourpuzzle.GameCharacter; 13import com.fourisland.fourpuzzle.GameCharacter;
14import com.fourisland.fourpuzzle.gamestate.mapview.Map; 14import com.fourisland.fourpuzzle.gamestate.mapview.Map;
15import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; 15import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState;
16import com.fourisland.fourpuzzle.gamestate.mapview.event.graphic.BlankEventGraphic;
16 17
17/** 18/**
18 * 19 *
@@ -33,16 +34,7 @@ public class HeroEvent extends AbstractEvent implements Event {
33 public void render(Graphics g) 34 public void render(Graphics g)
34 { 35 {
35 GameCharacter toDraw = Game.getSaveFile().getParty().getLeader(); 36 GameCharacter toDraw = Game.getSaveFile().getParty().getLeader();
36 37 if (!(toDraw.getGraphic() instanceof BlankEventGraphic))
37 /* TODO Replace below condition with an instanceof check to
38 * see if toDraw.getGraphic() is an instance of BlankEventGraphic.
39 * The current way does not, in fact, work because an EventGraphic
40 * never be equal to a String. This current way only exists because
41 * HeroEvent's graphic used to be stored as a filename/offset combo
42 * instead of as an EventGraphic.
43 */
44
45 if (!toDraw.getGraphic().equals("blank"))
46 { 38 {
47 toDraw.getGraphic().setDirection(direction); 39 toDraw.getGraphic().setDirection(direction);
48 toDraw.getGraphic().setAnimationStep(animationStep); 40 toDraw.getGraphic().setAnimationStep(animationStep);