From ff45151c6f8116d974cb06dca0047f6f2e5d5d05 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Wed, 27 Mar 2019 08:19:22 +0100 Subject: [PATCH] Give a clone of the map to the player --- tron/game.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tron/game.py b/tron/game.py index 02f99ed..7f54fd7 100644 --- a/tron/game.py +++ b/tron/game.py @@ -111,7 +111,7 @@ class Game: def map(self): """ - Returns the current map, the last map in the history. + Returns a clone of the current map, the last map in the history. """ return self.history[-1].map.clone() @@ -134,7 +134,7 @@ class Game: # Play next move for id, pp in enumerate(self.pps): - (pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.history[-1].map) + (pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.map()) # Update history with newly played move self.history[-1].player_one_direction = self.pps[0].player.direction