1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
This commit is contained in:
AlexVinS 2017-08-12 14:36:04 +03:00
parent 15138c23de
commit 8c0fab1dcf
19 changed files with 37 additions and 33 deletions

View File

@ -110,7 +110,7 @@ struct HeroObjectRetriever : boost::static_visitor<const CGHeroInstance *>
CPlayerInterface::CPlayerInterface(PlayerColor Player)
{
logGlobal->trace("\tHuman player interface for player %s being constructed", Player.getStr(false));
logGlobal->trace("\tHuman player interface for player %s being constructed", Player.getStr());
destinationTeleport = ObjectInstanceID();
destinationTeleportPos = int3(-1);
howManyPeople++;
@ -136,7 +136,7 @@ CPlayerInterface::CPlayerInterface(PlayerColor Player)
CPlayerInterface::~CPlayerInterface()
{
logGlobal->trace("\tHuman player interface for player %s being destructed", playerID.getStr(false));
logGlobal->trace("\tHuman player interface for player %s being destructed", playerID.getStr());
//howManyPeople--;
delete showingDialog;
delete cingconsole;

View File

@ -457,7 +457,7 @@ void CClient::newGame( CConnection *con, StartInfo *si )
if(!vstd::contains(myPlayers, color))
continue;
logNetwork->trace("Preparing interface for player %s", color.getStr(false));
logNetwork->trace("Preparing interface for player %s", color.getStr());
if(elem.second.playerID == PlayerSettings::PLAYER_AI)
{
auto AiToGive = aiNameForPlayer(elem.second, false);

View File

@ -291,7 +291,7 @@ void Graphics::blueToPlayersAdv(SDL_Surface * sur, PlayerColor player)
}
else
{
logGlobal->error("Wrong player id in blueToPlayersAdv (%s)!", player.getStr(false));
logGlobal->error("Wrong player id in blueToPlayersAdv (%s)!", player.getStr());
return;
}
SDL_SetColors(sur, palette, 224, 32);

View File

@ -819,7 +819,7 @@ void SaveGame::applyCl(CClient *cl)
void PlayerMessage::applyCl(CClient *cl)
{
logNetwork->debug("Player %s sends a message: %s", player.getStr(false), text);
logNetwork->debug("Player %s sends a message: %s", player.getStr(), text);
std::ostringstream str;
if(player.isSpectator())

View File

@ -336,7 +336,7 @@ CGHeroInstance * CGameState::HeroesPool::pickHeroFor(bool native, PlayerColor pl
}
if(!pool.size())
{
logGlobal->error("Cannot pick native hero for %s. Picking any...", player.getStr(false));
logGlobal->error("Cannot pick native hero for %s. Picking any...", player.getStr());
return pickHeroFor(false, player, town, available, rand);
}
else
@ -359,7 +359,7 @@ CGHeroInstance * CGameState::HeroesPool::pickHeroFor(bool native, PlayerColor pl
}
if(!pool.size() || sum == 0)
{
logGlobal->error("There are no heroes available for player %s!", player.getStr(false));
logGlobal->error("There are no heroes available for player %s!", player.getStr());
return nullptr;
}
@ -429,7 +429,7 @@ int CGameState::pickUnusedHeroTypeRandomly(PlayerColor owner)
return RandomGeneratorUtil::nextItem(factionHeroes, getRandomGenerator())->getNum();
}
logGlobal->warn("Cannot find free hero of appropriate faction for player %s - trying to get first available...", owner.getStr(false));
logGlobal->warn("Cannot find free hero of appropriate faction for player %s - trying to get first available...", owner.getStr());
if(!otherHeroes.empty())
{
return RandomGeneratorUtil::nextItem(otherHeroes, getRandomGenerator())->getNum();
@ -863,7 +863,7 @@ void CGameState::checkMapChecksum()
logGlobal->info("\tOur checksum for the map: %d", map->checksum);
if(scenarioOps->mapfileChecksum)
{
logGlobal->info("\tServer checksum for %s: ", scenarioOps->mapname, scenarioOps->mapfileChecksum);
logGlobal->info("\tServer checksum for %s: %d", scenarioOps->mapname, scenarioOps->mapfileChecksum);
if(map->checksum != scenarioOps->mapfileChecksum)
{
logGlobal->error("Wrong map checksum!!!");

View File

@ -302,7 +302,7 @@ void CIdentifierStorage::finalize()
{
for(auto object : registeredObjects)
{
logGlobal->trace("%s : %s -> %s", object.second.scope, object.first, object.second.id);
logGlobal->trace("%s : %s -> %d", object.second.scope, object.first, object.second.id);
}
logGlobal->error("All known identifiers were dumped into log file");
}
@ -466,7 +466,7 @@ void CContentHandler::preloadData(CModInfo & mod)
bool validate = (mod.validation != CModInfo::PASSED);
// print message in format [<8-symbols checksum>] <modname>
logGlobal->info("\t\t[%08d]%s", mod.checksum, mod.name);
logGlobal->info("\t\t[%08x]%s", mod.checksum, mod.name);
if (validate && mod.identifier != "core")
{

View File

@ -89,7 +89,7 @@ struct StartInfo
{
if(playerInfos.find(no) != playerInfos.end())
return playerInfos[no];
logGlobal->error("Cannot find info about player %s. Throwing...", no.getStr(false));
logGlobal->error("Cannot find info about player %s. Throwing...", no.getStr());
throw std::runtime_error("Cannot find info about player");
}
const PlayerSettings & getIthPlayersSettings(PlayerColor no) const

View File

@ -644,7 +644,7 @@ const CGHeroInstance * BattleInfo::getHero(PlayerColor player) const
if(sides[i].color == player)
return sides[i].hero;
logGlobal->error("Player %s is not in battle!", player.getStr(false));
logGlobal->error("Player %s is not in battle!", player.getStr());
return nullptr;
}
@ -659,7 +659,7 @@ ui8 BattleInfo::whatSide(PlayerColor player) const
if(sides[i].color == player)
return i;
logGlobal->warn("BattleInfo::whatSide: Player %s is not in battle!", player.getStr(false));
logGlobal->warn("BattleInfo::whatSide: Player %s is not in battle!", player.getStr());
return -1;
}

View File

@ -133,7 +133,7 @@ BattlePerspective::BattlePerspective CBattleInfoEssentials::battleGetMySide() co
if(*player == getBattle()->sides[1].color)
return BattlePerspective::RIGHT_SIDE;
logGlobal->error("Cannot find player %s in battle!", player.get().getStr(false));
logGlobal->error("Cannot find player %s in battle!", player->getStr());
return BattlePerspective::INVALID;
}
@ -267,7 +267,7 @@ BattleSideOpt CBattleInfoEssentials::playerToSide(PlayerColor player) const
RETURN_IF_NOT_BATTLE(boost::none);
int ret = vstd::find_pos_if(getBattle()->sides, [=](const SideInBattle &side){ return side.color == player; });
if(ret < 0)
logGlobal->warn("Cannot find side for player %s", player.getStr(false));
logGlobal->warn("Cannot find side for player %s", player.getStr());
return BattleSideOpt(ret);
}

View File

@ -43,7 +43,11 @@ CTraceLogger::CTraceLogger(const CLoggerBase * logger, const std::string & begin
{
logger->trace(beginMessage);
}
CTraceLogger::~CTraceLogger() { logger->trace(std::move(endMessage)); }
CTraceLogger::~CTraceLogger()
{
logger->trace(endMessage);
}
}//namespace vstd

View File

@ -170,7 +170,7 @@ void CGHeroInstance::setSecSkillLevel(SecondarySkill which, int val, bool abs)
if(elem.second > 3) //workaround to avoid crashes when same sec skill is given more than once
{
logGlobal->warn("Skill %d increased over limit! Decreasing to Expert.", which.toEnum());
logGlobal->warn("Skill %d increased over limit! Decreasing to Expert.", (int)which.toEnum());
elem.second = 3;
}
updateSkill(which, elem.second); //when we know final value

View File

@ -427,13 +427,13 @@ void CGPandoraBox::serializeJsonOptions(JsonSerializeFormat & handler)
for(const auto & p : skillMap.Struct())
{
const std::string id = p.first;
const std::string skillName = p.first;
const std::string levelId = p.second.String();
const int rawId = vstd::find_pos(NSecondarySkill::names, id);
const int rawId = vstd::find_pos(NSecondarySkill::names, skillName);
if(rawId < 0)
{
logGlobal->error("Invalid secondary skill %s", id);
logGlobal->error("Invalid secondary skill %s", skillName);
continue;
}

View File

@ -84,7 +84,7 @@ void CLoadFile::reportState(vstd::CLoggerBase * out)
{
out->debug("CLoadFile");
if(!!sfile && *sfile)
out->debug("\tOpened %s \tPosition: %d", fName, sfile->tellg());
out->debug("\tOpened %s Position: %d", fName, sfile->tellg());
}
void CLoadFile::clear()