Fix bug
This commit is contained in:
parent
8f7d3e9714
commit
3ff55f281e
12
tron/game.py
12
tron/game.py
|
@ -109,10 +109,10 @@ class Game:
|
|||
(pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.map())
|
||||
except:
|
||||
# An error occured during the evaluation of pp.player strategy
|
||||
if id == 1:
|
||||
self.winner = 2
|
||||
elif id == 2:
|
||||
if id == 0:
|
||||
self.winner = 1
|
||||
elif id == 1:
|
||||
self.winner = 0
|
||||
return False
|
||||
|
||||
|
||||
|
@ -134,10 +134,10 @@ class Game:
|
|||
pp.player.manage_event(event)
|
||||
except:
|
||||
# An error occured during the evaluation of pp.player strategy
|
||||
if id == 1:
|
||||
self.winner = 2
|
||||
elif id == 2:
|
||||
if id == 0:
|
||||
self.winner = 1
|
||||
elif id == 1:
|
||||
self.winner = 0
|
||||
return False
|
||||
|
||||
for (id, pp) in enumerate(self.pps):
|
||||
|
|
Loading…
Reference in New Issue