summaryrefslogtreecommitdiff
path: root/src/economy.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/economy.cpp
parent42b43c998314a3fcd89aa59ad7834104dd80b053 (diff)
downloadopenttd-4cebebcf683b079ff010e70b0a0a78c12734933e.tar.xz
Change: Add CargoTypes type for cargo masks. (#6790)
Diffstat (limited to 'src/economy.cpp')
-rw-r--r--src/economy.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/economy.cpp b/src/economy.cpp
index e97f61d6e..70b0bd837 100644
--- a/src/economy.cpp
+++ b/src/economy.cpp
@@ -1366,14 +1366,14 @@ struct IsEmptyAction
struct PrepareRefitAction
{
CargoArray &consist_capleft; ///< Capacities left in the consist.
- uint32 &refit_mask; ///< Bitmask of possible refit cargoes.
+ CargoTypes &refit_mask; ///< Bitmask of possible refit cargoes.
/**
* Create a refit preparation action.
* @param consist_capleft Capacities left in consist, to be updated here.
* @param refit_mask Refit mask to be constructed from refit information of vehicles.
*/
- PrepareRefitAction(CargoArray &consist_capleft, uint32 &refit_mask) :
+ PrepareRefitAction(CargoArray &consist_capleft, CargoTypes &refit_mask) :
consist_capleft(consist_capleft), refit_mask(refit_mask) {}
/**
@@ -1469,7 +1469,7 @@ static void HandleStationRefit(Vehicle *v, CargoArray &consist_capleft, Station
Backup<CompanyByte> cur_company(_current_company, v->owner, FILE_LINE);
- uint32 refit_mask = v->GetEngine()->info.refit_mask;
+ CargoTypes refit_mask = v->GetEngine()->info.refit_mask;
/* Remove old capacity from consist capacity and collect refit mask. */
IterateVehicleParts(v_start, PrepareRefitAction(consist_capleft, refit_mask));
@@ -1627,10 +1627,10 @@ static void LoadUnloadVehicle(Vehicle *front)
bool completely_emptied = true;
bool anything_unloaded = false;
bool anything_loaded = false;
- uint32 full_load_amount = 0;
- uint32 cargo_not_full = 0;
- uint32 cargo_full = 0;
- uint32 reservation_left = 0;
+ CargoTypes full_load_amount = 0;
+ CargoTypes cargo_not_full = 0;
+ CargoTypes cargo_full = 0;
+ CargoTypes reservation_left = 0;
front->cur_speed = 0;
@@ -1838,7 +1838,7 @@ static void LoadUnloadVehicle(Vehicle *front)
/* if the aircraft carries passengers and is NOT full, then
* continue loading, no matter how much mail is in */
if ((front->type == VEH_AIRCRAFT && IsCargoInClass(front->cargo_type, CC_PASSENGERS) && front->cargo_cap > front->cargo.StoredCount()) ||
- (cargo_not_full && (cargo_full & ~cargo_not_full) == 0)) { // There are still non-full cargoes
+ (cargo_not_full != 0 && (cargo_full & ~cargo_not_full) == 0)) { // There are still non-full cargoes
finished_loading = false;
}
} else if (cargo_not_full != 0) {