1
0

fix bug where a death player is killed multiple time during the same day

This commit is contained in:
andrea
2025-07-26 15:31:28 +02:00
parent 551c2ef8ef
commit 5f0d6ad3f5

View File

@@ -48,10 +48,10 @@ def play_one_day_debug(Arena):
daily_events= [] daily_events= []
_rand.shuffle(alive_players) _rand.shuffle(alive_players)
for p_one in alive_players: for p_one in alive_players:
if not p_one.is_alive(): continue #he could be dead during this day cycle if not p_one.is_alive(): continue # he could be dead during this day cycle
p_two= _rand.sample(alive_players, 1)[0] p_two= _rand.sample(Arena.get_alive_players(), 1)[0]
while p_one.get_id() == p_two.get_id(): while p_one.get_id() == p_two.get_id():
p_two= _rand.sample(alive_players, 1)[0] p_two= _rand.sample(Arena.get_alive_players(), 1)[0]
_dmg, msg= p_one.attack(p_two) _dmg, msg= p_one.attack(p_two)
daily_events.append(msg) daily_events.append(msg)