(svn r25361) -Feature: distribute cargo according to plan given by linkgraph

This commit is contained in:
fonsinchen
2013-06-09 13:03:48 +00:00
parent a2ff96d682
commit 04e3eb6fab
16 changed files with 586 additions and 206 deletions

View File

@@ -29,7 +29,7 @@
* to the current tile of the vehicle to prevent excessive profits
*/
FOR_ALL_VEHICLES(v) {
const VehicleCargoList::List *packets = v->cargo.Packets();
const CargoPacketList *packets = v->cargo.Packets();
for (VehicleCargoList::ConstIterator it(packets->begin()); it != packets->end(); it++) {
CargoPacket *cp = *it;
cp->source_xy = Station::IsValidID(cp->source) ? Station::Get(cp->source)->xy : v->tile;
@@ -47,7 +47,7 @@
for (CargoID c = 0; c < NUM_CARGO; c++) {
GoodsEntry *ge = &st->goods[c];
const StationCargoList::List *packets = ge->cargo.Packets();
const StationCargoPacketMap *packets = ge->cargo.Packets();
for (StationCargoList::ConstIterator it(packets->begin()); it != packets->end(); it++) {
CargoPacket *cp = *it;
cp->source_xy = Station::IsValidID(cp->source) ? Station::Get(cp->source)->xy : st->xy;