home · contact · privacy
Server: Inform player about his inability to swim on move towards water.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 23 Feb 2016 23:39:19 +0000 (00:39 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 23 Feb 2016 23:39:19 +0000 (00:39 +0100)
server/commands.py

index f20297d31da9041562a4acd9cdf44ecd130f3ba4..3717202e38354c7b38eb585ac2d948870dae5b69 100644 (file)
@@ -499,6 +499,9 @@ def play_move(str_arg):
         move_result = mv_yx_in_dir_legal(chr(dir), t["T_POSY"], t["T_POSX"])
         if 1 == move_result[0]:
             pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
+            if ord("~") == world_db["MAP"][pos]:
+                log("You can't SWIM.")
+                return
             if chr(world_db["MAP"][pos]) in symbols_passable:
                 world_db["Things"][0]["T_ARGUMENT"] = dir
                 set_command("move")