Code review comment for lp:~widelands-dev/widelands/bug-1811583-desync-with-territorial

Revision history for this message
Toni Förster (stonerl) wrote :

I have an idea but no clue how to implement this:

the lua part:

function wait_for_roadbuilding()
  local game_type = wl.Game().game_type
  if game_type = singleplayer then
   _await_animation()
   while (wl.ui.MapView().is_building_road) do sleep(2000) end
  end
end

The c++ part I got from src/wui/tribal_encyclopedia.cc

if (game->game_controller()->get_game_type() == GameController::GameType::kSingleplayer) {
    cr->push_arg("singleplayer");
} else {
    cr->push_arg("multiplayer");
}

So if someone with more knowledge could do this..

« Back to merge proposal