From 370ab3ef297d4584436d70a59a41115aa0b2a70b Mon Sep 17 00:00:00 2001 From: truelight Date: Mon, 24 Jan 2005 20:20:30 +0000 Subject: (svn r1642) -Fix: solve AI related order-problem --- ai.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ai.c b/ai.c index 0b8259bed..74164a0e8 100644 --- a/ai.c +++ b/ai.c @@ -267,14 +267,11 @@ static void AiHandleGotoDepot(Player *p, int cmd) static void AiRestoreVehicleOrders(Vehicle *v, BackuppedOrders *bak) { - const Order *os = bak->order; - int ind = 0; + int i; - while (os++->type != OT_NOTHING) { - if (DoCommandByTile(0, v->index + (ind << 16), PackOrder(os), DC_EXEC, CMD_INSERT_ORDER) == CMD_ERROR) + for (i = 0; bak->order[i].type != OT_NOTHING; i++) + if (!DoCommandP(0, v->index + (i << 16), PackOrder(&bak->order[i]), NULL, CMD_INSERT_ORDER | CMD_NO_TEST_IF_IN_NETWORK)) break; - ind++; - } } static void AiHandleReplaceTrain(Player *p) -- cgit v1.2.3-70-g09d2