mirror of
https://gitlab.com/Oreolek/salet.git
synced 2024-07-04 07:45:03 +03:00
goBack() now returns to start if it's too early to tell.
This commit is contained in:
parent
e3e17eb295
commit
f6fb0fe96f
|
@ -304,7 +304,11 @@ class Salet
|
||||||
# Go back N rooms. It's not an UNDO.
|
# Go back N rooms. It's not an UNDO.
|
||||||
# Also, steps = 1 is the current room
|
# Also, steps = 1 is the current room
|
||||||
@goBack = (steps = 2) =>
|
@goBack = (steps = 2) =>
|
||||||
@processClick(@progress.path[@progress.path.length - steps])
|
if @progress.path.length > steps
|
||||||
|
location = @progress.path[@progress.path.length - steps]
|
||||||
|
else
|
||||||
|
location = @start
|
||||||
|
@processClick(location)
|
||||||
|
|
||||||
# Transition between rooms.
|
# Transition between rooms.
|
||||||
@doTransitionTo = (newRoomId) =>
|
@doTransitionTo = (newRoomId) =>
|
||||||
|
|
Loading…
Reference in a new issue