mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
7 days without castle loss condition. Minor fixes.
This commit is contained in:
@ -575,6 +575,15 @@ DLL_EXPORT void NewTurn::applyGs( CGameState *gs )
|
||||
if(gs->getDate(1) == 7) //new week
|
||||
BOOST_FOREACH(CGHeroInstance *h, gs->map->heroes)
|
||||
h->bonuses.remove_if(HeroBonus::OneWeek);
|
||||
|
||||
//count days without town
|
||||
for( std::map<ui8, PlayerState>::iterator i=gs->players.begin() ; i!=gs->players.end();i++)
|
||||
{
|
||||
if(i->second.towns.size() || gs->day == 1)
|
||||
i->second.daysWithoutCastle = 0;
|
||||
else
|
||||
i->second.daysWithoutCastle++;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_EXPORT void SetObjectProperty::applyGs( CGameState *gs )
|
||||
|
Reference in New Issue
Block a user