home · contact · privacy
Don't enter enter_hat menu in client if not wearing hat.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 13 Dec 2020 04:31:33 +0000 (05:31 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 13 Dec 2020 04:31:33 +0000 (05:31 +0100)
rogue_chat.html
rogue_chat_curses.py

index 4285ded541ea1912fd83f36ba37337761407f074..26322e94a31c3e797a07924704bfb4e3963e983c 100644 (file)
@@ -794,15 +794,15 @@ let tui = {
     }
     this.draw_face = false;
     this.tile_draw = false;
-      if (mode_name == 'command_thing' && (!game.player.carrying
-                                           || !game.player.carrying.commandable)) {
+    if (mode_name == 'command_thing' && (!game.player.carrying
+                                         || !game.player.carrying.commandable)) {
         return fail('not carrying anything commandable', 'play');
-    };
-    if (mode_name == 'take_thing' && game.player.carrying) {
+    } else if (mode_name == 'take_thing' && game.player.carrying) {
         return fail('already carrying something', 'play');
-    };
-    if (mode_name == 'drop_thing' && !game.player.carrying) {
+    } else if (mode_name == 'drop_thing' && !game.player.carrying) {
         return fail('not carrying anything droppable', 'play');
+    } else if (mode_name == 'enter_hat' && !game.player.hat) {
+        return fail('not wearing hat to edit', 'edit');
     }
     if (mode_name == 'admin_enter' && this.is_admin) {
         mode_name = 'admin';
index e9f7f6b93c21936d37e783eb9d2d651553e8fc0d..9519a95609a82ba0f9a0fd4f7d7bca95999f756e 100755 (executable)
@@ -686,6 +686,8 @@ class TUI:
             return fail('already carrying something')
         if mode_name == 'drop_thing' and not self.game.player.carrying:
             return fail('not carrying anything droppable')
+        if mode_name == 'enter_hat' and not hasattr(self.game.player, 'hat'):
+            return fail('not wearing hat to edit', 'edit')
         if mode_name == 'admin_enter' and self.is_admin:
             mode_name = 'admin'
         elif mode_name in {'name_thing', 'admin_thing_protect'}: