From f2504d85560a9e1fb283307b7063d35600408a55 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Thu, 29 May 2014 20:43:44 -0400 Subject: [PATCH] assert that do_init_side functions are never called with bad arg --- src/play_controller.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 145f8b6c84d2..0b7f326a867b 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -621,6 +621,7 @@ void play_controller::maybe_do_init_side(const unsigned int team_index, bool is_ * For all other sides it is recorded in replay and replay handler has to handle * calling do_init_side() functions. **/ + assert(team_index == player_number_ - 1); if (is_replay || init_side_done_ || !current_team().is_local()) { return; } @@ -640,6 +641,7 @@ void play_controller::maybe_do_init_side(const unsigned int team_index, bool is_ * Called by replay handler or init_side() to do actual work for turn change. */ void play_controller::do_init_side(const unsigned int team_index, bool is_replay, bool only_visual) { + assert(team_index == player_number_ - 1); log_scope("player turn"); //In case we might end up calling sync:network during the side turn events, //and we dont want do_init_side to be called when a player drops.