File diff r27319:ea7c4a418203 → r27320:a815d811abc1
src/saveload/afterload.cpp
Show inline comments
 
@@ -280,15 +280,15 @@ static void InitializeWindowsAndCaches()
 
		if (s->airport.psa != nullptr) {
 
			s->airport.psa->feature = GSF_AIRPORTS;
 
			s->airport.psa->tile = s->airport.tile;
 
		}
 
	}
 
	for (Town *t : Town::Iterate()) {
 
		for (std::list<PersistentStorage *>::iterator it = t->psa_list.begin(); it != t->psa_list.end(); ++it) {
 
			(*it)->feature = GSF_FAKE_TOWNS;
 
			(*it)->tile = t->xy;
 
		for (auto &it : t->psa_list) {
 
			it->feature = GSF_FAKE_TOWNS;
 
			it->tile = t->xy;
 
		}
 
	}
 
	for (RoadVehicle *rv : RoadVehicle::Iterate()) {
 
		if (rv->IsFrontEngine()) {
 
			rv->CargoChanged();
 
		}
 
@@ -2154,19 +2154,17 @@ bool AfterLoadGame()
 
		 * currently at a station and loading/unloading. If they don't get any
 
		 * payment anymore they just removed in the next load/unload cycle.
 
		 * However, some 0.7 versions might have cargo payment. For those we just
 
		 * add cargopayment for the vehicles that don't have it.
 
		 */
 
		for (Station *st : Station::Iterate()) {
 
			std::list<Vehicle *>::iterator iter;
 
			for (iter = st->loading_vehicles.begin(); iter != st->loading_vehicles.end(); ++iter) {
 
			for (Vehicle *v : st->loading_vehicles) {
 
				/* There are always as many CargoPayments as Vehicles. We need to make the
 
				 * assert() in Pool::GetNew() happy by calling CanAllocateItem(). */
 
				static_assert(CargoPaymentPool::MAX_SIZE == VehiclePool::MAX_SIZE);
 
				assert(CargoPayment::CanAllocateItem());
 
				Vehicle *v = *iter;
 
				if (v->cargo_payment == nullptr) v->cargo_payment = new CargoPayment(v);
 
			}
 
		}
 
	}
 

	
 
	if (IsSavegameVersionBefore(SLV_122)) {