Permalink
Browse files

Added logic to fix minor issue.

  • Loading branch information...
1 parent c0e874a commit 99432b99611d4773ebdbbff776fe1ee33176034a @mcantelon committed Jan 9, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 standard_commands/get.yaml
@@ -30,11 +30,22 @@ logic: |
if can_get == true
- # player is only allowed to carry 6 items
+ # make sure player isn't already carrying maximum
if !@player.can_carry_number_of_items \
|| @player.carrying.size <= (@player.can_carry_number_of_items - 1)
prop.location = 'player'
+
+ # if prop is supported by something, remove it from it
+ @props.each do |prop_to_check,data|
+ if @props[prop_to_check].traits['supporting']
+ if @props[prop_to_check].traits['supporting'].index(prop.id)
+ @props[prop_to_check].traits['supporting'].delete(prop.id)
+ output << "(Removing #{prop.noun} from #{@props[prop_to_check].noun}.)\n"
+ end
+ end
+ end
+
output << "You take #{prop.noun}.\n"
on_get_output = @game.event(prop, 'on_get')

0 comments on commit 99432b9

Please sign in to comment.