mirror of
https://github.com/vcmi/vcmi.git
synced 2025-04-19 12:02:24 +02:00
Added important fix reverted in r1817.
This commit is contained in:
parent
dbe38a7062
commit
1f2e9bf9c2
@ -630,11 +630,6 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
|
|||||||
BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
|
BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
|
||||||
h->bonuses.remove_if(Bonus::OneDay);
|
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
|
if(gs->getDate(1)) //new week, Monday that is
|
||||||
{
|
{
|
||||||
for( std::map<ui8, PlayerState>::iterator i=gs->players.begin() ; i!=gs->players.end();i++)
|
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);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1210,6 +1210,7 @@ void CGameHandler::newTurn()
|
|||||||
NewTurn n2; //just to handle creature growths after bonuses are applied
|
NewTurn n2; //just to handle creature growths after bonuses are applied
|
||||||
n2.specialWeek = NewTurn::NO_ACTION;
|
n2.specialWeek = NewTurn::NO_ACTION;
|
||||||
n2.day = gs->day;
|
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
|
for(std::vector<CGTownInstance *>::iterator j = gs->map->towns.begin(); j!=gs->map->towns.end(); j++)//handle towns
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user