mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-06-26 03:50:49 +03:00
Don't save actions inside rooms we don't save in
This commit is contained in:
parent
5403c65167
commit
f17d6ba476
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salet",
|
||||
"version": "1.4.7",
|
||||
"version": "1.4.8",
|
||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||
"homepage": "http://salet.oreolek.ru",
|
||||
|
|
|
@ -290,6 +290,20 @@ class Salet
|
|||
@processClick = (code) ->
|
||||
now = (new Date()).getTime() * 0.001
|
||||
@time = now - @startTime
|
||||
|
||||
# don't save any actions in the room we can't save in
|
||||
# and remember that the action of entering the start room is always saved
|
||||
match = code.match(@linkRe)
|
||||
room = match[1]
|
||||
if room
|
||||
if room == '.'
|
||||
room = @getCurrentRoom()
|
||||
else
|
||||
room = @getRoom(code)
|
||||
if !room.canSave
|
||||
# don't save
|
||||
return @processLink(code)
|
||||
|
||||
@progress.sequence.push({link:code, when:@time})
|
||||
if @getRoom(code)? # if it's a room
|
||||
@progress.path.push(code)
|
||||
|
|
Loading…
Reference in a new issue