Add advice to "exit" command by itself for "quit" command to quit the game

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2021-11-18 21:28:35 -08:00
parent 2841b1418c
commit dc47b228f0

View File

@@ -333,6 +333,10 @@ class GoTrigger(Trigger):
if not item_name: if not item_name:
otrigger = match["trigger"].lower().capitalize() otrigger = match["trigger"].lower().capitalize()
game.say(f"{otrigger} where?") game.say(f"{otrigger} where?")
if otrigger.lower() == "exit":
# I really really really hate this hack, but regex can only go so far
# perhaps a real parser is in order :I
game.say("{{Perhaps you meant ((quit))}}{{ to leave the game?}}")
return return
item = game.room.search_item_name(item_name) item = game.room.search_item_name(item_name)
if item and GO in item.triggers and item.revealed: if item and GO in item.triggers and item.revealed: