Codechange: replace some min/clamp constructs to ClampTo

This commit is contained in:
Rubidium
2023-04-29 10:19:43 +02:00
committed by rubidium42
parent 19ec4e8beb
commit fb856e16c1
18 changed files with 59 additions and 60 deletions

View File

@@ -294,7 +294,7 @@ TownScopeResolver *StationResolverObject::GetTown()
}
break;
case 0xFA: return Clamp(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); // Build date, clamped to a 16 bit value
case 0xFA: return ClampTo<uint16_t>(TimerGameCalendar::date - DAYS_TILL_ORIGINAL_BASE_YEAR); // Build date, clamped to a 16 bit value
}
*available = false;
@@ -384,7 +384,7 @@ TownScopeResolver *StationResolverObject::GetTown()
case 0x84: return this->st->string_id;
case 0x86: return 0;
case 0xF0: return this->st->facilities;
case 0xFA: return Clamp(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535);
case 0xFA: return ClampTo<uint16_t>(this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR);
}
return this->st->GetNewGRFVariable(this->ro, variable, parameter, available);