(svn r12586) -Codechange: do not access an order's refit variables directly.

This commit is contained in:
rubidium
2008-04-06 07:07:21 +00:00
parent 84e3fa75e1
commit 3edb967ecf
6 changed files with 55 additions and 25 deletions

View File

@@ -2243,11 +2243,11 @@ void VehicleEnterDepot(Vehicle *v)
t = v->current_order;
v->current_order.MakeDummy();
if (t.refit_cargo < NUM_CARGO) {
if (t.IsRefit()) {
CommandCost cost;
_current_player = v->owner;
cost = DoCommand(v->tile, v->index, t.refit_cargo | t.refit_subtype << 8, DC_EXEC, GetCmdRefitVeh(v));
cost = DoCommand(v->tile, v->index, t.GetRefitCargo() | t.GetRefitSubtype() << 8, DC_EXEC, GetCmdRefitVeh(v));
if (CmdFailed(cost)) {
v->leave_depot_instantly = false; // We ensure that the vehicle stays in the depot