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

Method FixPointers

src/saveload/order_sl.cpp:354–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352 }
353
354 void FixPointers() const override
355 {
356 bool migrate_orders = IsSavegameVersionBefore(SLV_ORDERS_OWNED_BY_ORDERLIST);
357
358 for (OrderBackup *ob : OrderBackup::Iterate()) {
359 SlObject(ob, GetOrderBackupDescription());
360
361 if (migrate_orders) {
362 std::vector<Order> orders;
363 for (OldOrderSaveLoadItem *old_order = GetOldOrder(ob->old_order_index); old_order != nullptr; old_order = GetOldOrder(old_order->next)) {
364 orders.push_back(std::move(old_order->order));
365 }
366 ob->orders = std::move(orders);
367 }
368 }
369 }
370};
371
372static const BKORChunkHandler BKOR;

Callers

nothing calls this directly

Calls 5

IsSavegameVersionBeforeFunction · 0.85
SlObjectFunction · 0.85
GetOldOrderFunction · 0.85
push_backMethod · 0.80

Tested by

no test coverage detected