1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Cleaning logs.

This commit is contained in:
DjWarmonger 2014-09-10 19:09:48 +02:00
parent 228700b1a7
commit d9273b3b2a
3 changed files with 13 additions and 3 deletions

View File

@ -73,8 +73,16 @@ bool CGameInfoCallback::isAllowed( int type, int id )
const PlayerState * CGameInfoCallback::getPlayer(PlayerColor color, bool verbose) const
{
ERROR_VERBOSE_OR_NOT_RET_VAL_IF(!hasAccess(color), verbose, "Cannot access player " << color << "info!", nullptr);
//if (!vstd::contains(gs->players, color))
//{
// logGlobal->errorStream() << "Cannot access player " << color << "info!";
// return nullptr; //macros are not really useful when debugging :?
//}
//else
//{
ERROR_VERBOSE_OR_NOT_RET_VAL_IF(!vstd::contains(gs->players,color), verbose, "Cannot find player " << color << "info!", nullptr);
return &gs->players[color];
//}
}
const CTown * CGameInfoCallback::getNativeTown(PlayerColor color) const

View File

@ -3521,6 +3521,6 @@ CPathfinder::CPathfinder(CPathsInfo &_out, CGameState *_gs, const CGHeroInstance
CRandomGenerator & CGameState::getRandomGenerator()
{
logGlobal->traceStream() << "Fetching CGameState::rand with seed " << rand.nextInt();
//logGlobal->traceStream() << "Fetching CGameState::rand with seed " << rand.nextInt();
return rand;
}

View File

@ -4757,9 +4757,11 @@ void CGameHandler::handleTimeEvents()
while(gs->map->events.size() && gs->map->events.front().firstOccurence+1 == gs->day)
{
CMapEvent ev = gs->map->events.front();
for(int player = 0; player < PlayerColor::PLAYER_LIMIT_I; player++)
for (auto p : gs->players)
{
PlayerState *pinfo = gs->getPlayer(PlayerColor(player));
auto player = p.first.getNum();
auto pinfo = &p.second;
if( pinfo //player exists
&& (ev.players & 1<<player) //event is enabled to this player