1
0
Fork 0
mirror of https://gitlab.com/Oreolek/salet.git synced 2024-07-02 06:45:06 +03:00

goBack() now returns to start if it's too early to tell.

This commit is contained in:
Alexander Yakovlev 2016-03-28 11:17:28 +07:00
parent e3e17eb295
commit f6fb0fe96f

View file

@ -304,7 +304,11 @@ class Salet
# Go back N rooms. It's not an UNDO.
# Also, steps = 1 is the current room
@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.
@doTransitionTo = (newRoomId) =>