summaryrefslogtreecommitdiff
path: root/src/autoreplace_cmd.cpp
diff options
context:
space:
mode:
authorPeterN <peter@fuzzle.org>2018-05-21 22:08:39 +0100
committerGitHub <noreply@github.com>2018-05-21 22:08:39 +0100
commit4cebebcf683b079ff010e70b0a0a78c12734933e (patch)
tree4f140272bd8c1efba4916a642b85a22f153cb7b4 /src/autoreplace_cmd.cpp
parent42b43c998314a3fcd89aa59ad7834104dd80b053 (diff)
downloadopenttd-4cebebcf683b079ff010e70b0a0a78c12734933e.tar.xz
Change: Add CargoTypes type for cargo masks. (#6790)
Diffstat (limited to 'src/autoreplace_cmd.cpp')
-rw-r--r--src/autoreplace_cmd.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp
index e69ac66eb..96eada734 100644
--- a/src/autoreplace_cmd.cpp
+++ b/src/autoreplace_cmd.cpp
@@ -37,8 +37,8 @@ extern void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index);
*/
static bool EnginesHaveCargoInCommon(EngineID engine_a, EngineID engine_b)
{
- uint32 available_cargoes_a = GetUnionOfArticulatedRefitMasks(engine_a, true);
- uint32 available_cargoes_b = GetUnionOfArticulatedRefitMasks(engine_b, true);
+ CargoTypes available_cargoes_a = GetUnionOfArticulatedRefitMasks(engine_a, true);
+ CargoTypes available_cargoes_b = GetUnionOfArticulatedRefitMasks(engine_b, true);
return (available_cargoes_a == 0 || available_cargoes_b == 0 || (available_cargoes_a & available_cargoes_b) != 0);
}
@@ -173,9 +173,8 @@ static void TransferCargo(Vehicle *old_veh, Vehicle *new_head, bool part_of_chai
*/
static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_type)
{
-
- uint32 union_refit_mask_a = GetUnionOfArticulatedRefitMasks(v->engine_type, false);
- uint32 union_refit_mask_b = GetUnionOfArticulatedRefitMasks(engine_type, false);
+ CargoTypes union_refit_mask_a = GetUnionOfArticulatedRefitMasks(v->engine_type, false);
+ CargoTypes union_refit_mask_b = GetUnionOfArticulatedRefitMasks(engine_type, false);
const Order *o;
const Vehicle *u = (v->type == VEH_TRAIN) ? v->First() : v;
@@ -201,7 +200,7 @@ static bool VerifyAutoreplaceRefitForOrders(const Vehicle *v, EngineID engine_ty
*/
static CargoID GetNewCargoTypeForReplace(Vehicle *v, EngineID engine_type, bool part_of_chain)
{
- uint32 available_cargo_types, union_mask;
+ CargoTypes available_cargo_types, union_mask;
GetArticulatedRefitMasks(engine_type, true, &union_mask, &available_cargo_types);
if (union_mask == 0) return CT_NO_REFIT; // Don't try to refit an engine with no cargo capacity