diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2009-01-28 16:47:47 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2009-01-28 16:47:47 -0500 |
commit | f5884d91e90e858b2672ef416071941fea786923 (patch) | |
tree | 5c7d16c51587e58f589bb6fada53d7099a8e16f5 /src/com | |
parent | 7171798052557dab8b3e6febfc027bf5b1b52941 (diff) | |
download | fourpuzzle-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.java | 12 |
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; | |||
13 | import com.fourisland.fourpuzzle.GameCharacter; | 13 | import com.fourisland.fourpuzzle.GameCharacter; |
14 | import com.fourisland.fourpuzzle.gamestate.mapview.Map; | 14 | import com.fourisland.fourpuzzle.gamestate.mapview.Map; |
15 | import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; | 15 | import com.fourisland.fourpuzzle.gamestate.mapview.MapViewGameState; |
16 | import 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); |