1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

- fixes for several bugs: #639 #656 #135 #646 #638 #94 #629

- re-enabled console on Linux to allow disabling AI
This commit is contained in:
Ivan Savenko
2011-01-01 20:26:39 +00:00
parent 3d9dc0642d
commit b8f65697ca
14 changed files with 127 additions and 111 deletions

View File

@ -4554,8 +4554,13 @@ void CGameHandler::handleTimeEvents()
if(ev->nextOccurence)
{
gs->map->events.pop_front();
ev->firstOccurence += ev->nextOccurence;
gs->map->events.sort(evntCmp);
std::list<CMapEvent*>::iterator it = gs->map->events.begin();
while ( it !=gs->map->events.end() && **it <= *ev )
it++;
gs->map->events.insert(it, ev);
}
else
{
@ -4615,9 +4620,14 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n, std::map<
}
if(ev->nextOccurence)
{
{
town->events.pop_front();
ev->firstOccurence += ev->nextOccurence;
town->events.sort(evntCmp);
std::list<CCastleEvent*>::iterator it = town->events.begin();
while ( it !=town->events.end() && **it <= *ev )
it++;
town->events.insert(it, ev);
}
else
{