diff --git a/client/UIFramework/SDL_Extensions.h b/client/UIFramework/SDL_Extensions.h index 35dff84de..bc2777897 100644 --- a/client/UIFramework/SDL_Extensions.h +++ b/client/UIFramework/SDL_Extensions.h @@ -48,6 +48,13 @@ namespace Colors const SDL_Color Maize = createColor(242, 226, 110); // http://en.wikipedia.org/wiki/Maize_%28color%29 } +//MSVC gives an error when calling abs with ui64 -> we add template that will match calls with unsigned arg and return it +template +typename boost::enable_if_c::type, T>::type abs(T arg) +{ + return arg; +} + template std::string makeNumberShort(IntType number) //the output is a string containing at most 5 characters [4 if positive] (eg. intead 10000 it gives 10k) { diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index e27de11e5..956543e4a 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -308,14 +308,13 @@ DLL_LINKAGE void RemoveObject::applyGs( CGameState *gs ) return; } - //FIXME: for some reason this code causes crash in Bonus System ?! auto quest = dynamic_cast(obj); if (quest) { - BOOST_FOREACH (auto player, gs->players) + BOOST_FOREACH (auto &player, gs->players) { - BOOST_FOREACH (auto q, player.second.quests) + BOOST_FOREACH (auto &q, player.second.quests) { if (q.obj == obj) {