From 235ad4ab6bf3133517a7a779c398e30f51bdbbad Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 30 Aug 2007 13:03:56 +0000 Subject: (svn r11003) -Codechange: replace Vehicle->next to Vehicle->Next() and Vehicle->SetNext() so we can trap instances that change a next pointer and (in the future) update the first/previous pointers based on that. --- src/ai/default/default.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ai') diff --git a/src/ai/default/default.cpp b/src/ai/default/default.cpp index b28e2a2b8..87306b6bc 100644 --- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -261,8 +261,8 @@ static EngineID AiChooseTrainToReplaceWith(const Player* p, const Vehicle* v) const Vehicle* u = v; int num = 0; - while (++num, u->next != NULL) { - u = u->next; + while (++num, u->Next() != NULL) { + u = u->Next(); } // XXX: check if a wagon @@ -2496,7 +2496,7 @@ handle_nocash: // Sell a vehicle if the train is double headed. v = GetVehicle(loco_id); - if (v->next != NULL) { + if (v->Next() != NULL) { i = p->ai.wagon_list[p->ai.num_wagons * 2 - 2]; p->ai.wagon_list[p->ai.num_wagons * 2 - 2] = INVALID_VEHICLE; DoCommand(tile, i, 0, DC_EXEC, CMD_SELL_RAIL_WAGON); -- cgit v1.2.3-70-g09d2