Fix cargo mask truncation in CargoMaskValueFilter and LinkRefresher::RefreshLinks
This commit is contained in:
@@ -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 {
|
||||
|
@@ -577,7 +577,7 @@ template <typename F> CargoTypes FilterCargoMask(F filter_func, CargoTypes cargo
|
||||
|
||||
template <typename T, typename F> 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);
|
||||
|
Reference in New Issue
Block a user