|
@@ -318,25 +318,26 @@ static uint32 HouseGetVariable(const Res
|
|
|
}
|
|
|
|
|
|
/* Cargo acceptance history of nearby stations */
|
|
|
case 0x64: {
|
|
|
CargoID cid = GetCargoTranslation(parameter, object->grffile);
|
|
|
if (cid == CT_INVALID) return 0;
|
|
|
|
|
|
/* Extract tile offset. */
|
|
|
int8 x_offs = GB(GetRegister(0x100), 0, 8);
|
|
|
int8 y_offs = GB(GetRegister(0x100), 8, 8);
|
|
|
TileIndex testtile = TILE_MASK(tile + TileDiffXY(x_offs, y_offs));
|
|
|
|
|
|
const StationList *sl = StationFinder(TileArea(testtile, 1, 1)).GetStations();
|
|
|
StationFinder stations(TileArea(testtile, 1, 1));
|
|
|
const StationList *sl = stations.GetStations();
|
|
|
|
|
|
/* Collect acceptance stats. */
|
|
|
uint32 res = 0;
|
|
|
for (Station * const * st_iter = sl->Begin(); st_iter != sl->End(); st_iter++) {
|
|
|
const Station *st = *st_iter;
|
|
|
if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_EVER_ACCEPTED)) SetBit(res, 0);
|
|
|
if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_LAST_MONTH)) SetBit(res, 1);
|
|
|
if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_CURRENT_MONTH)) SetBit(res, 2);
|
|
|
if (HasBit(st->goods[cid].acceptance_pickup, GoodsEntry::GES_ACCEPTED_BIGTICK)) SetBit(res, 3);
|
|
|
}
|
|
|
|
|
|
/* Cargo triggered CB 148? */
|