src/autoreplace_cmd.cpp
changeset 10194 64a3dd322cd2
parent 10193 ae0dc7f699bf
child 10198 75f7455a4d4a
equal deleted inserted replaced
10193:ae0dc7f699bf 10194:64a3dd322cd2
   380 			TransferCargo(old_v, new_v, false);
   380 			TransferCargo(old_v, new_v, false);
   381 
   381 
   382 			*single_unit = new_v;
   382 			*single_unit = new_v;
   383 		}
   383 		}
   384 
   384 
   385 		if (cost.Succeeded()) {
   385 		/* Sell the old vehicle */
   386 			/* Sell the old vehicle */
   386 		cost.AddCost(DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v)));
   387 			cost.AddCost(DoCommand(0, old_v->index, 0, flags, GetCmdSellVeh(old_v)));
       
   388 		}
       
   389 
   387 
   390 		/* If we are not in DC_EXEC undo everything */
   388 		/* If we are not in DC_EXEC undo everything */
   391 		if ((flags & DC_EXEC) == 0) {
   389 		if ((flags & DC_EXEC) == 0) {
   392 			DoCommand(0, new_v->index, 0, DC_EXEC, GetCmdSellVeh(new_v));
   390 			DoCommand(0, new_v->index, 0, DC_EXEC, GetCmdSellVeh(new_v));
   393 		}
   391 		}