1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-28 14:44:28 +01:00

Codechange: Make Price an enum class.

This commit is contained in:
Cyprian Klimaszewski
2026-01-12 22:22:45 +01:00
committed by rubidium42
parent b556dc24b8
commit 322ce224b4
42 changed files with 325 additions and 326 deletions

View File

@@ -924,10 +924,10 @@ static CommandCost TerraformTile_Object(TileIndex tile, DoCommandFlags flags, in
if (spec->callback_mask.Test(ObjectCallbackMask::Autoslope)) {
/* If the callback fails, allow autoslope. */
uint16_t res = GetObjectCallback(CBID_OBJECT_AUTOSLOPE, 0, 0, spec, Object::GetByTile(tile), tile);
if (res == CALLBACK_FAILED || !ConvertBooleanCallback(spec->grf_prop.grffile, CBID_OBJECT_AUTOSLOPE, res)) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]);
if (res == CALLBACK_FAILED || !ConvertBooleanCallback(spec->grf_prop.grffile, CBID_OBJECT_AUTOSLOPE, res)) return CommandCost(EXPENSES_CONSTRUCTION, _price[Price::BuildFoundation]);
} else if (spec->IsEnabled()) {
/* allow autoslope */
return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]);
return CommandCost(EXPENSES_CONSTRUCTION, _price[Price::BuildFoundation]);
}
}
}