diff --git a/src/linkgraph/refresh.cpp b/src/linkgraph/refresh.cpp index fc43277c17..b5e288cb53 100644 --- a/src/linkgraph/refresh.cpp +++ b/src/linkgraph/refresh.cpp @@ -345,7 +345,7 @@ void LinkRefresher::RefreshLinks(const Order *cur, const Order *next, uint8 flag } if (cur->IsType(OT_GOTO_STATION) || cur->IsType(OT_IMPLICIT)) { - if (cur->CanLeaveWithCargo(HasBit(flags, HAS_CARGO), FindFirstBit(this->cargo_mask))) { + if (cur->CanLeaveWithCargo(HasBit(flags, HAS_CARGO), FindFirstBit64(this->cargo_mask))) { SetBit(flags, HAS_CARGO); this->RefreshStats(cur, next); } else { diff --git a/src/order_base.h b/src/order_base.h index 9de61093f0..4326f2e53a 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -577,7 +577,7 @@ template CargoTypes FilterCargoMask(F filter_func, CargoTypes cargo template T CargoMaskValueFilter(CargoTypes &cargo_mask, F filter_func) { - CargoID first_cargo_id = FindFirstBit(cargo_mask); + CargoID first_cargo_id = FindFirstBit64(cargo_mask); T value = filter_func(first_cargo_id); CargoTypes other_cargo_mask = cargo_mask; ClrBit(other_cargo_mask, first_cargo_id);