MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / LoadOldGood

Function LoadOldGood

src/saveload/oldloader_sl.cpp:725–743  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

723};
724
725static bool LoadOldGood(LoadgameState &ls, int num)
726{
727 /* for TTO games, 12th (num == 11) goods entry is created in the Station constructor */
728 if (_savegame_type == SGT_TTO && num == 11) return true;
729
730 Station *st = Station::Get(_current_station_id);
731 GoodsEntry *ge = &st->goods[num];
732
733 if (!LoadChunk(ls, ge, goods_chunk)) return false;
734
735 ge->status.Set(GoodsEntry::State::Acceptance, HasBit(_waiting_acceptance, 15));
736 ge->status.Set(GoodsEntry::State::Rating, _cargo_source != 0xFF);
737 if (GB(_waiting_acceptance, 0, 12) != 0 && CargoPacket::CanAllocateItem()) {
738 ge->GetOrCreateData().cargo.Append(new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_periods, (_cargo_source == 0xFF) ? StationID::Invalid() : StationID{_cargo_source}, INVALID_TILE, 0),
739 StationID::Invalid());
740 }
741
742 return true;
743}
744
745static const OldChunks station_chunk[] = {
746 OCL_SVAR( OC_TILE, Station, xy ),

Callers

nothing calls this directly

Calls 6

LoadChunkFunction · 0.85
HasBitFunction · 0.85
GBFunction · 0.85
InvalidFunction · 0.85
SetMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected