Give a clone of the map to the player

This commit is contained in:
Thomas Forgione 2019-03-27 08:19:22 +01:00
parent aa5b65aecc
commit ff45151c6f
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 2 additions and 2 deletions

View File

@ -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