summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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]