special[timer]: try to avoid calling them two times in a row...

This commit is contained in:
Laurent Alonso(fr)
2020-05-15 08:35:47 +02:00
committed by Celtic Minstrel
parent 749cfb5ab7
commit 78cf927a29

View File

@@ -1847,7 +1847,12 @@ void special_increase_age(long length, bool queue) {
if(univ.town->timers[i].time > 0) {
short time = univ.town->timers[i].time;
bool need_redraw = false;
for(unsigned long j = age_before + (time == 1); j <= current_age; j++)
// age_before is already done excepted the first time,
// so maybe j = age_before + ((age_before || time==1) ? 1 : 0)
// checkme: currently, in combat, current_pc_picked_in_spec_enc picks only the current character
// which seems bad, it seems better to alway pick the party in these cases:
// case eSpecCtx::TOWN_TIMER: case eSpecCtx::SCEN_TIMER: case eSpecCtx::PARTY_TIMER
for(unsigned long j = age_before + 1; j <= current_age; j++)
if(j % time == 0) {
if(queue) {
univ.party.age = j;
@@ -1864,7 +1869,7 @@ void special_increase_age(long length, bool queue) {
if(univ.scenario.scenario_timers[i].time > 0) {
short time = univ.scenario.scenario_timers[i].time;
bool need_redraw = false;
for(unsigned long j = age_before + (time == 1); j <= current_age; j++)
for(unsigned long j = age_before + 1; j <= current_age; j++)
if(j % time == 0) {
if(queue) {
univ.party.age = j;