summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo k <mo@mokhan.ca>2012-02-13 16:46:57 -0700
committermo k <mo@mokhan.ca>2012-02-13 16:46:57 -0700
commitee6968d6fde0072e4bdb1e7b1b047189a6c7157e (patch)
tree29474cbff173f7ea7dc250d498b9ee7eb5e0db6d
parent02e8a7c716002db61ee09a2d91508bb1d6d2f719 (diff)
clone the current location
-rwxr-xr-xlib/terrain.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/terrain.rb b/lib/terrain.rb
index 795bf6d..f3a1a60 100755
--- a/lib/terrain.rb
+++ b/lib/terrain.rb
@@ -4,7 +4,7 @@ class Terrain
end
def move_forward( heading, location)
- new_location = heading.forward(location)
+ new_location = heading.forward(location.clone)
if( new_location[:x] < @map[:x] && new_location[:x] > 0 && new_location[:y] < @map[:y] && new_location[:y] > 0)
location[:x] = new_location[:x]
location[:y] = new_location[:y]