| 723 | }; |
| 724 | |
| 725 | static 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 | |
| 745 | static const OldChunks station_chunk[] = { |
| 746 | OCL_SVAR( OC_TILE, Station, xy ), |