mirror of
https://github.com/vcmi/vcmi.git
synced 2025-12-01 23:12:49 +02:00
change town events to vector + use getDefaultAllowed for spells
This commit is contained in:
@@ -3413,7 +3413,7 @@ void CGameHandler::handleTimeEvents()
|
||||
|
||||
void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
|
||||
{
|
||||
town->events.sort(evntCmp);
|
||||
std::sort(town->events.begin(), town->events.end(), evntCmp);
|
||||
while(town->events.size() && town->events.front().firstOccurrence == gs->day)
|
||||
{
|
||||
PlayerColor player = town->tempOwner;
|
||||
@@ -3474,7 +3474,7 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
|
||||
|
||||
if (ev.nextOccurrence)
|
||||
{
|
||||
town->events.pop_front();
|
||||
town->events.erase(town->events.begin());
|
||||
|
||||
ev.firstOccurrence += ev.nextOccurrence;
|
||||
auto it = town->events.begin();
|
||||
@@ -3484,7 +3484,7 @@ void CGameHandler::handleTownEvents(CGTownInstance * town, NewTurn &n)
|
||||
}
|
||||
else
|
||||
{
|
||||
town->events.pop_front();
|
||||
town->events.erase(town->events.begin());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user