diff --git a/client/mapView/MapRenderer.cpp b/client/mapView/MapRenderer.cpp index da9f7027d..86d67dcff 100644 --- a/client/mapView/MapRenderer.cpp +++ b/client/mapView/MapRenderer.cpp @@ -98,8 +98,13 @@ void MapTileStorage::load(size_t index, const std::string & filename, EImageBlit for(auto & entry : terrainAnimations) { - entry = std::make_unique(filename); - entry->preload(); + if (!filename.empty()) + { + entry = std::make_unique(filename); + entry->preload(); + } + else + entry = std::make_unique(); for(size_t i = 0; i < entry->size(); ++i) entry->getImage(i)->setBlitMode(blitMode); diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index b9d140d5b..15a02192f 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -2166,6 +2166,7 @@ void BattleTriggerEffect::applyGs(CGameState * gs) const break; } case Bonus::ENCHANTER: + case Bonus::MORALE: break; case Bonus::FEAR: st->fear = true; diff --git a/lib/serializer/Connection.cpp b/lib/serializer/Connection.cpp index ca7845ae0..ec00d5c63 100644 --- a/lib/serializer/Connection.cpp +++ b/lib/serializer/Connection.cpp @@ -83,7 +83,7 @@ CConnection::CConnection(const std::string & host, ui16 port, std::string Name, if(error) { logNetwork->error("Problem with resolving: \n%s", error.message()); - goto connerror1; + throw std::runtime_error("Can't establish connection: Problem with resolving"); } pom = endpoint_iterator; if(pom != end) @@ -91,7 +91,7 @@ CConnection::CConnection(const std::string & host, ui16 port, std::string Name, else { logNetwork->error("Critical problem: No endpoints found!"); - goto connerror1; + throw std::runtime_error("Can't establish connection: No endpoints found!"); } while(pom != end) { @@ -110,20 +110,12 @@ CConnection::CConnection(const std::string & host, ui16 port, std::string Name, } else { - logNetwork->error("Problem with connecting: %s", error.message()); + throw std::runtime_error("Can't establish connection: Failed to connect!"); } endpoint_iterator++; } - - //we shouldn't be here - error handling -connerror1: - logNetwork->error("Something went wrong... checking for error info"); - if(error) - logNetwork->error(error.message()); - else - logNetwork->error("No error info. "); - throw std::runtime_error("Can't establish connection :("); } + CConnection::CConnection(std::shared_ptr Socket, std::string Name, std::string UUID): iser(this), oser(this),