Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[bin/crypt] player needs to be somewhere to take

  • Loading branch information...
commit f03f3ca205c09c563573d78bb469012f9d93cf17 1 parent 08ad1f3
@masak authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/crypt
View
4 bin/crypt
@@ -637,6 +637,9 @@ class Adventure::Engine {
}
method take($thing) {
+ die X::Adventure::PlayerNowhere.new()
+ unless defined $!player_location;
+
# XXX: should check if the thing is there
die X::Adventure::ThingNotCarryable.new(:action<take>, :$thing)
@@ -1472,6 +1475,7 @@ multi MAIN('test') {
$engine.place_thing('table', 'saloon');
# don't make table carryable
+ $engine.place_player('saloon');
throws_exception
{ $engine.take('table') },
X::Adventure::ThingNotCarryable,
Please sign in to comment.
Something went wrong with that request. Please try again.