(svn r6624) -Feature: added ability to add refit commands to vehicle orders (can only be done in goto depot orders)

Example: make a train transport iron ore from A to B, then it visits a depot and refits to steel
     It then transport steel back to A or near A if there is a factory and then it visits another depot to refit to iron ore again

   This is controlled in the orders. If a goto depot order is lightlighted, then "Unload" changes to "Refit"
   Control click "Refit" removes the refit part of the order (as the tooltip says)
   The player will still pay the normal refit costs

   Known issues:
      If a vehicle is not in a depot, then the refit window will fail to tell refitted cargo capacity
      Refit costs in the refit window can sometimes print 0 when it should not because the refit calculation is unaware that the vehicle will be refitted in between

   Warning: autoreplace got a protection against replacing something so you get a new cargo type, but it can fail here. In the iron ore/steel example, it can see that
      the vehicle carries iron ore and the new one can be refitted to iron ore, then it will replace. It will not check to see that it's valid for steel as well.
      This is something to look into in the future
This commit is contained in:
bjarni
2006-10-03 14:52:39 +00:00
parent 7b1053c350
commit ea63050d5f
20 changed files with 172 additions and 22 deletions

View File

@@ -1518,5 +1518,21 @@ bool AfterLoadGame(void)
}
}
/* Setting no refit flags to all orders in savegames from before refit in orders were added */
if (CheckSavegameVersion(36)) {
Order *order;
Vehicle *v;
FOR_ALL_ORDERS(order) {
order->refit_cargo = CT_NO_REFIT;
order->refit_subtype = CT_NO_REFIT;
}
FOR_ALL_VEHICLES(v) {
v->current_order.refit_cargo = CT_NO_REFIT;
v->current_order.refit_subtype = CT_NO_REFIT;
}
}
return true;
}