Fix potential infinite loop if a timed starts another timer
This commit is contained in:
@@ -1785,7 +1785,7 @@ void push_things() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void special_increase_age(long length, bool queue) {
|
void special_increase_age(long length, bool queue) {
|
||||||
unsigned short i;
|
size_t i;
|
||||||
short s1,s2,s3;
|
short s1,s2,s3;
|
||||||
bool redraw = false,stat_area = false;
|
bool redraw = false,stat_area = false;
|
||||||
location trigger_loc;
|
location trigger_loc;
|
||||||
@@ -1876,13 +1876,14 @@ void special_increase_age(long length, bool queue) {
|
|||||||
redraw = true;
|
redraw = true;
|
||||||
}
|
}
|
||||||
univ.party.age = current_age;
|
univ.party.age = current_age;
|
||||||
for(i = 0; i < univ.party.party_event_timers.size(); i++) {
|
auto party_timers = univ.party.party_event_timers;
|
||||||
if(univ.party.party_event_timers[i].time <= length) {
|
for(i = 0; i < party_timers.size(); i++) {
|
||||||
univ.party.age = age_before + univ.party.party_event_timers[i].time;
|
if(party_timers[i].time <= length) {
|
||||||
short which_type = univ.party.party_event_timers[i].node_type;
|
univ.party.age = age_before + party_timers[i].time;
|
||||||
|
short which_type = party_timers[i].node_type;
|
||||||
if(queue)
|
if(queue)
|
||||||
queue_special(eSpecCtx::PARTY_TIMER, which_type, univ.party.party_event_timers[i].node, trigger_loc);
|
queue_special(eSpecCtx::PARTY_TIMER, which_type, party_timers[i].node, trigger_loc);
|
||||||
else run_special(eSpecCtx::PARTY_TIMER,which_type,univ.party.party_event_timers[i].node,trigger_loc,&s1,&s2,&s3);
|
else run_special(eSpecCtx::PARTY_TIMER, which_type, party_timers[i].node, trigger_loc, &s1, &s2, &s3);
|
||||||
univ.party.party_event_timers[i].time = 0;
|
univ.party.party_event_timers[i].time = 0;
|
||||||
univ.party.party_event_timers[i].node = -1;
|
univ.party.party_event_timers[i].node = -1;
|
||||||
stat_area = true;
|
stat_area = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user