summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-17 11:52:06 +0000
committerrubidium <rubidium@openttd.org>2008-08-17 11:52:06 +0000
commit8035f120b41c31b7b20d2f8b67612cd90e449712 (patch)
tree3a8f68bd86db9b0f7a82b99e456a4ef63be850a7
parent99ac60e5e130cacd0fad15452060a768dc42287a (diff)
downloadopenttd-8035f120b41c31b7b20d2f8b67612cd90e449712.tar.xz
(svn r14092) -Cleanup (r14083): dead code, i.e. unused function.
-rw-r--r--src/order_cmd.cpp36
-rw-r--r--src/order_func.h1
2 files changed, 0 insertions, 37 deletions
diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp
index 07154ee1f..6cf6cfeea 100644
--- a/src/order_cmd.cpp
+++ b/src/order_cmd.cpp
@@ -1341,42 +1341,6 @@ void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *bak)
DoCommandP(0, bak->group, v->index, NULL, CMD_ADD_VEHICLE_GROUP);
}
-/** Restores vehicle orders that was previously backed up by BackupVehicleOrders()
- * This will restore to the point where it was at the time of the backup meaning
- * it will presume the same order indexes can be used.
- * This is needed when restoring a backed up vehicle
- * @param v The vehicle that should gain the orders
- * @param bak the backup of the orders
- */
-void RestoreVehicleOrdersBruteForce(Vehicle *v, const BackuppedOrders *bak)
-{
- if (bak->name != NULL) {
- /* Restore the name. */
- v->name = strdup(bak->name);
- }
-
- /* If we had shared orders, recover that */
- if (bak->clone != INVALID_VEHICLE) {
- /* We will place it at the same location in the linked list as it previously was. */
- if (v->prev_shared != NULL) {
- assert(v->prev_shared->next_shared == v->next_shared);
- v->prev_shared->next_shared = v;
- }
- if (v->next_shared != NULL) {
- assert(v->next_shared->prev_shared == v->prev_shared);
- v->next_shared->prev_shared = v;
- }
- } else {
- /* Restore the orders at the indexes they originally were. */
- for (Order *order = bak->order; order->IsValid(); order++) {
- Order *dst = GetOrder(order->index);
- /* Since we are restoring something we removed a moment ago all the orders should be free. */
- assert(!dst->IsValid());
- memcpy(dst, order, sizeof(Order));
- }
- }
-}
-
/** Restore the current order-index of a vehicle and sets service-interval.
* @param tile unused
* @param flags operation to perform
diff --git a/src/order_func.h b/src/order_func.h
index 1e7c051bb..ab1c88abd 100644
--- a/src/order_func.h
+++ b/src/order_func.h
@@ -28,7 +28,6 @@ extern BackuppedOrders _backup_orders_data;
void BackupVehicleOrders(const Vehicle *v, BackuppedOrders *order = &_backup_orders_data);
void RestoreVehicleOrders(const Vehicle *v, const BackuppedOrders *order = &_backup_orders_data);
-void RestoreVehicleOrdersBruteForce(Vehicle *v, const BackuppedOrders *bak);
/* Functions */
void RemoveOrderFromAllVehicles(OrderType type, DestinationID destination);