Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit f03f3ca205c09c563573d78bb469012f9d93cf17 1 parent 08ad1f3
Carl Mäsak authored July 15, 2012

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  bin/crypt
4  bin/crypt
@@ -637,6 +637,9 @@ class Adventure::Engine {
637 637
     }
638 638
 
639 639
     method take($thing) {
  640
+        die X::Adventure::PlayerNowhere.new()
  641
+            unless defined $!player_location;
  642
+
640 643
         # XXX: should check if the thing is there
641 644
 
642 645
         die X::Adventure::ThingNotCarryable.new(:action<take>, :$thing)
@@ -1472,6 +1475,7 @@ multi MAIN('test') {
1472 1475
 
1473 1476
         $engine.place_thing('table', 'saloon');
1474 1477
         # don't make table carryable
  1478
+        $engine.place_player('saloon');
1475 1479
         throws_exception
1476 1480
             { $engine.take('table') },
1477 1481
             X::Adventure::ThingNotCarryable,

0 notes on commit f03f3ca

Please sign in to comment.
Something went wrong with that request. Please try again.