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

Added important fix reverted in r1817.

This commit is contained in:
DjWarmonger 2010-10-31 07:11:28 +00:00
parent dbe38a7062
commit 1f2e9bf9c2
2 changed files with 6 additions and 5 deletions

View File

@ -630,11 +630,6 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
h->bonuses.remove_if(Bonus::OneDay);
if(resetBuilded) //reset amount of structures set in this turn in towns
{
BOOST_FOREACH(CGTownInstance* t, gs->map->towns)
t->builded = 0;
}
if(gs->getDate(1)) //new week, Monday that is
{
for( std::map<ui8, PlayerState>::iterator i=gs->players.begin() ; i!=gs->players.end();i++)
@ -690,6 +685,11 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
i->second.bonuses.remove_if(Bonus::OneDay);
}
if(resetBuilded) //reset amount of structures set in this turn in towns
{
BOOST_FOREACH(CGTownInstance* t, gs->map->towns)
t->builded = 0;
}
}
}

View File

@ -1210,6 +1210,7 @@ void CGameHandler::newTurn()
NewTurn n2; //just to handle creature growths after bonuses are applied
n2.specialWeek = NewTurn::NO_ACTION;
n2.day = gs->day;
n2.resetBuilded = true;
for(std::vector<CGTownInstance *>::iterator j = gs->map->towns.begin(); j!=gs->map->towns.end(); j++)//handle towns
{