mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 04:13:26 +00:00
(svn r16268) -Fix (r9876): When callback 2E returns an amount of 0, do not transport 1 unit to the station.
This commit is contained in:
parent
bdf0b9491d
commit
552f10bb09
@ -2973,6 +2973,9 @@ void FindStationsAroundTiles(TileIndex tile, int w_prod, int h_prod, StationList
|
||||
|
||||
uint MoveGoodsToStation(TileIndex tile, int w, int h, CargoID type, uint amount)
|
||||
{
|
||||
/* Return if nothing to do. Also the rounding below fails for 0. */
|
||||
if (amount == 0) return 0;
|
||||
|
||||
Station *st1 = NULL; // Station with best rating
|
||||
Station *st2 = NULL; // Second best station
|
||||
uint best_rating1 = 0; // rating of st1
|
||||
|
@ -455,6 +455,8 @@ static void TileLoop_Town(TileIndex tile)
|
||||
if (cargo == CT_INVALID) continue;
|
||||
|
||||
uint amt = GB(callback, 0, 8);
|
||||
if (amt == 0) continue;
|
||||
|
||||
uint moved = MoveGoodsToStation(tile, 1, 1, cargo, amt);
|
||||
|
||||
const CargoSpec *cs = GetCargo(cargo);
|
||||
|
Loading…
Reference in New Issue
Block a user