diff --git a/lib/salet.coffee b/lib/salet.coffee index d5a847b..72c7a70 100644 --- a/lib/salet.coffee +++ b/lib/salet.coffee @@ -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) =>