From 441208180035f8b6241640f81b05411448c85729 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Sun, 27 Mar 2016 22:34:16 +0700 Subject: [PATCH] New flag: room.canSave This fixes the problem with saving inside Inventory room. --- game/begin.coffee | 1 + lib/room.coffee | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/game/begin.coffee b/game/begin.coffee index 79500ef..fb63958 100644 --- a/game/begin.coffee +++ b/game/begin.coffee @@ -39,6 +39,7 @@ room "start", salet, # The inventory button is a regular link to this room. # You may alter these as much as you like or scrap it along with the button. room "inventory", salet, + canSave: false # saving the game here is forbidden. Aautosaving too. enter: () -> $("#inventory").hide() exit: () -> diff --git a/lib/room.coffee b/lib/room.coffee index 626e6d1..a76d54b 100644 --- a/lib/room.coffee +++ b/lib/room.coffee @@ -23,6 +23,7 @@ class SaletRoom @canChoose = true @priority = 1 @displayOrder = 1 + @canSave = true @tags = [] @choices = "" @optionText = "Choice" @@ -99,7 +100,7 @@ class SaletRoom if @afterChoices? @afterChoices.fcall(this, system, f) - if system.autosave + if system.autosave and @canSave system.saveGame() ###