Codefix: Add missing const inside script functions. (#12794)

Scripts do not modify items directly, marking them const enforces this.
This commit is contained in:
Peter Nelson
2024-06-17 07:19:56 +01:00
committed by GitHub
parent 7db70f9c3f
commit 731c56d116
9 changed files with 35 additions and 23 deletions

View File

@@ -687,11 +687,11 @@ static void _DoCommandReturnSetOrderFlags(class ScriptInstance *instance)
{
if (vehicle_type == ScriptVehicle::VT_AIR) {
if (ScriptTile::IsStationTile(origin_tile)) {
Station *orig_station = ::Station::GetByTile(origin_tile);
const Station *orig_station = ::Station::GetByTile(origin_tile);
if (orig_station != nullptr && orig_station->airport.tile != INVALID_TILE) origin_tile = orig_station->airport.tile;
}
if (ScriptTile::IsStationTile(dest_tile)) {
Station *dest_station = ::Station::GetByTile(dest_tile);
const Station *dest_station = ::Station::GetByTile(dest_tile);
if (dest_station != nullptr && dest_station->airport.tile != INVALID_TILE) dest_tile = dest_station->airport.tile;
}