SourceForge has been redesigned. Learn more.
Close

#1 Fix for bug [ 1059445 ] water

closed-accepted
None
5
2004-11-17
2004-11-10
No

This patch fixes the bug reported in [ 1059445 ] water
quoted here:

I'm not sure this is a bug, just a little thing I
noticed. If you go over to water and kick it it says
"You kick the wall- Ouch!"

I fixed it mainly by checking the type of the tile
you're kicking. If it's the sea, I display a custom
message ("Your attempt to kick the sea only gets your
foot wet."). Otherwise, I display the default message.

The contents of the patch follows:

Index: Combat.java

RCS file:
/cvsroot/tyrant/tyrant/mikera/tyrant/Combat.java,v
retrieving revision 1.22
diff -u -r1.22 Combat.java
--- Combat.java 28 Oct 2004 18:00:16 -0000 1.22
+++ Combat.java 10 Nov 2004 23:03:57 -0000
@@ -256,8 +256,14 @@
t = t.next;
}
if (m.isBlocked(b.x + dx, b.y + dy)) {
- Game.message("You kick the wall - Ouch!");
-
+ switch (m.getTile(b.x + dx,b.y + dy)) {
+ case Tile.SEA:
+ Game.message("Your attempt to kick the sea
only gets your foot wet.");
+ break;
+ default:
+ Game.message("You kick the wall - Ouch!");
+ break;
+ }
return;
}
t = m.getObjects(b.x + dx, b.y + dy);

Discussion

  • Mike Anderson

    Mike Anderson - 2004-11-17

    Logged In: YES
    user_id=6450

    I've applied the patch in a slightly modified form with a
    bit of refectoring to move the code to Tile.java

     
  • Mike Anderson

    Mike Anderson - 2004-11-17
    • assigned_to: nobody --> mikera
    • status: open --> closed-accepted
     

Log in to post a comment.