diff --git a/lib/room.coffee b/lib/room.coffee index a76d54b..beeee5c 100644 --- a/lib/room.coffee +++ b/lib/room.coffee @@ -24,6 +24,7 @@ class SaletRoom @priority = 1 @displayOrder = 1 @canSave = true + @canExit = true @tags = [] @choices = "" @optionText = "Choice" @@ -63,6 +64,14 @@ class SaletRoom Also if f == this.name (we're in the same location) the `before` and `after` callbacks are ignored. ### @entering = (system, f) => + if ( + f != @name and + f? and + system.rooms[f].canExit? and + system.rooms[f].canExit == false + ) + return system.goTo(f, f) + if @clear and f? system.view.clearContent() else