(svn r20547) -Change: the way order backups are performed. Now restoring an order doesn't require up to 765 commands.

This commit is contained in:
rubidium
2010-08-18 20:48:38 +00:00
parent 04d6648c5e
commit 926594b599
13 changed files with 237 additions and 130 deletions

View File

@@ -976,12 +976,7 @@ struct DepotWindow : Window {
this->SetDirty();
int sell_cmd = (v->type == VEH_TRAIN && (widget == DEPOT_WIDGET_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0;
bool is_engine = (v->type != VEH_TRAIN || Train::From(v)->IsFrontEngine());
if (is_engine) OrderBackup::Backup(v);
if (!DoCommandP(v->tile, v->index | sell_cmd << 16, 0, GetCmdSellVeh(v->type)) && is_engine) OrderBackup::Reset(this->window_number);
DoCommandP(v->tile, v->index | sell_cmd << 16 | MAKE_ORDER_BACKUP_FLAG, 0, GetCmdSellVeh(v->type));
break;
}