(svn r9072) -Codechange: [Orders] added methods to orders to free them and check if they are in use

This commit is contained in:
bjarni
2007-03-08 21:39:34 +00:00
parent e2eeac06f8
commit 0ad237611e
9 changed files with 46 additions and 55 deletions

View File

@@ -486,9 +486,9 @@ static bool LoadOldOrder(LoadgameState *ls, int num)
AssignOrder(GetOrder(num), UnpackOldOrder(_old_order));
/* Relink the orders to eachother (in TTD(Patch) the orders for one
vehicle are behind eachother, with OT_NOTHING as indication that
vehicle are behind eachother, with an invalid order (OT_NOTHING) as indication that
it is the last order */
if (num > 0 && GetOrder(num)->type != OT_NOTHING)
if (num > 0 && GetOrder(num)->IsValid())
GetOrder(num - 1)->next = GetOrder(num);
return true;