--- src/game/game.cpp | 7 ++++--- src/game/game_blitz.cpp | 2 +- src/game/game_classic.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/game/game.cpp b/src/game/game.cpp index 480a5da..4935674 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -570,9 +570,10 @@ bool Game::NewBox() // if started with "-d box", get one box per turn if (!IsLOGGING("box")) { - // .7 is a magic number to get the probability of boxes falling once every round close to .333 - double randValue = RandomLocal().GetDouble(); - if(randValue > (1 - pow(.5, 1.0 / nbr_teams))) { + double boxDropProbability = (1 - pow(.5, 1.0 / nbr_teams)); + MSG_DEBUG("random.get", "Game::NewBox(...) drop box?"); + double randValue = RandomSync().GetDouble(); + if(randValue > boxDropProbability) { return false; } } diff --git a/src/game/game_blitz.cpp b/src/game/game_blitz.cpp index f432a3b..ff146b3 100644 --- a/src/game/game_blitz.cpp +++ b/src/game/game_blitz.cpp @@ -136,7 +136,7 @@ void GameBlitz::RefreshClock() if (IsGameFinished()) break; - if (Network::GetInstance()->IsTurnMaster() && give_objbox && GetWorld().IsOpen()) { + if (give_objbox && GetWorld().IsOpen()) { NewBox(); give_objbox = false; break; diff --git a/src/game/game_classic.cpp b/src/game/game_classic.cpp index 1fa9611..4ab92b3 100644 --- a/src/game/game_classic.cpp +++ b/src/game/game_classic.cpp @@ -117,7 +117,7 @@ void GameClassic::RefreshClock() break; } - if (Network::GetInstance()->IsTurnMaster() && give_objbox && GetWorld().IsOpen()) { + if (give_objbox && GetWorld().IsOpen()) { NewBox(); give_objbox = false; break; -- 1.6.0.4 _______________________________________________ Wormux-dev mailing list Wormux-dev@gna.org https://mail.gna.org/listinfo/wormux-dev