From 15e001af2a6fd15c5c7321ed6a3561b44eb21216 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Mon, 1 Feb 2016 20:28:05 +0700 Subject: [PATCH] Autosaving (issue #9) --- lib/room.coffee | 3 +++ lib/salet.coffee | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/room.coffee b/lib/room.coffee index 7660388..cb10aa8 100644 --- a/lib/room.coffee +++ b/lib/room.coffee @@ -112,6 +112,9 @@ class SaletRoom if @choices system.view.writeChoices(system, system.getSituationIdChoices(@choices, @maxChoices)) + if system.autosave + system.saveGame() + ### An internal function to get the room's description and the descriptions of every object in this room. diff --git a/lib/salet.coffee b/lib/salet.coffee index 6379d9d..f581f00 100644 --- a/lib/salet.coffee +++ b/lib/salet.coffee @@ -28,6 +28,7 @@ class Salet # REDEFINE THIS IN YOUR GAME game_id: null game_version: "1.0" + autosave: true rnd: null time: 0