Permalink
Browse files

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

  • Loading branch information...
1 parent 08ad1f3 commit f03f3ca205c09c563573d78bb469012f9d93cf17 @masak committed Jul 15, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 bin/crypt
View
@@ -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,

0 comments on commit f03f3ca

Please sign in to comment.