From d524cfceadd9338a18759e8a7ea1db659cd6cbb5 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Wed, 9 Dec 2020 02:49:24 +0100 Subject: [PATCH] In clients, don't open dropping direction menu if not carrying droppable. --- rogue_chat.html | 6 ++++++ rogue_chat_curses.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/rogue_chat.html b/rogue_chat.html index 9d5eddf..1c1fd1a 100644 --- a/rogue_chat.html +++ b/rogue_chat.html @@ -770,6 +770,12 @@ let tui = { this.switch_mode('play'); return; }; + if (mode_name == 'drop_thing' && (!player.carrying)) { + this.log_msg('? not carrying anything droppable'); + terminal.blink_screen(); + this.switch_mode('play'); + return; + } if (mode_name == 'admin_enter' && this.is_admin) { mode_name = 'admin'; } else if (['name_thing', 'admin_thing_protect'].includes(mode_name)) { diff --git a/rogue_chat_curses.py b/rogue_chat_curses.py index 657523f..2d51ce8 100755 --- a/rogue_chat_curses.py +++ b/rogue_chat_curses.py @@ -635,6 +635,12 @@ class TUI: self.flash = True self.switch_mode('play') return + if mode_name == 'drop_thing' and\ + not (hasattr(player, 'carrying' or player.carrying)): + self.log_msg('? not carrying anything droppable') + self.flash = True + self.switch_mode('play') + return if mode_name == 'admin_enter' and self.is_admin: mode_name = 'admin' elif mode_name in {'name_thing', 'admin_thing_protect'}: -- 2.30.2