(svn r17800) -Codechange: first steps into making CargoList a template

This commit is contained in:
rubidium
2009-10-18 14:28:26 +00:00
parent aa75552957
commit e553983e39
6 changed files with 47 additions and 28 deletions

View File

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