mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fixed false error messages on game startup
This commit is contained in:
@@ -98,8 +98,13 @@ void MapTileStorage::load(size_t index, const std::string & filename, EImageBlit
|
||||
|
||||
for(auto & entry : terrainAnimations)
|
||||
{
|
||||
entry = std::make_unique<CAnimation>(filename);
|
||||
entry->preload();
|
||||
if (!filename.empty())
|
||||
{
|
||||
entry = std::make_unique<CAnimation>(filename);
|
||||
entry->preload();
|
||||
}
|
||||
else
|
||||
entry = std::make_unique<CAnimation>();
|
||||
|
||||
for(size_t i = 0; i < entry->size(); ++i)
|
||||
entry->getImage(i)->setBlitMode(blitMode);
|
||||
|
@@ -2166,6 +2166,7 @@ void BattleTriggerEffect::applyGs(CGameState * gs) const
|
||||
break;
|
||||
}
|
||||
case Bonus::ENCHANTER:
|
||||
case Bonus::MORALE:
|
||||
break;
|
||||
case Bonus::FEAR:
|
||||
st->fear = true;
|
||||
|
@@ -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<TSocket> Socket, std::string Name, std::string UUID):
|
||||
iser(this),
|
||||
oser(this),
|
||||
|
Reference in New Issue
Block a user