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

Function LoadOldOrder

src/saveload/oldloader_sl.cpp:652–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650};
651
652static bool LoadOldOrder(LoadgameState &ls, int num)
653{
654 if (!LoadChunk(ls, nullptr, order_chunk)) return false;
655
656 OldOrderSaveLoadItem &o = AllocateOldOrder(num);
657 o.order.AssignOrder(UnpackOldOrder(_old_order));
658
659 if (!o.order.IsType(OT_NOTHING) && num > 0) {
660 /* Relink the orders to each other (in the orders for one vehicle are behind each other,
661 * with an invalid order (OT_NOTHING) as indication that it is the last order */
662 OldOrderSaveLoadItem *prev = GetOldOrder(num + 1 - 1);
663 if (prev != nullptr) prev->next = num + 1; // next is 1-based.
664 }
665
666 return true;
667}
668
669static bool LoadOldAnimTileList(LoadgameState &ls, int)
670{

Callers

nothing calls this directly

Calls 5

LoadChunkFunction · 0.85
UnpackOldOrderFunction · 0.85
GetOldOrderFunction · 0.85
AssignOrderMethod · 0.80
IsTypeMethod · 0.80

Tested by

no test coverage detected