336 DrawWindowWidgets(w); |
336 DrawWindowWidgets(w); |
337 |
337 |
338 WP(w, refit_d).cargo = DrawVehicleRefitWindow(WP(w, refit_d).list, WP(w, refit_d).sel, w->vscroll.pos, w->vscroll.cap, w->resize.step_height); |
338 WP(w, refit_d).cargo = DrawVehicleRefitWindow(WP(w, refit_d).list, WP(w, refit_d).sel, w->vscroll.pos, w->vscroll.cap, w->resize.step_height); |
339 |
339 |
340 if (WP(w, refit_d).cargo != NULL) { |
340 if (WP(w, refit_d).cargo != NULL) { |
341 int32 cost; |
341 CommandCost cost; |
342 |
342 |
343 cost = DoCommand(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, |
343 cost = DoCommand(v->tile, v->index, WP(w, refit_d).cargo->cargo | WP(w, refit_d).cargo->subtype << 8, |
344 DC_QUERY_COST, GetCmdRefitVeh(GetVehicle(w->window_number)->type)); |
344 DC_QUERY_COST, GetCmdRefitVeh(GetVehicle(w->window_number)->type)); |
345 |
345 |
346 if (!CmdFailed(cost)) { |
346 if (CmdSucceeded(cost)) { |
347 SetDParam(0, WP(w, refit_d).cargo->cargo); |
347 SetDParam(0, WP(w, refit_d).cargo->cargo); |
348 SetDParam(1, _returned_refit_capacity); |
348 SetDParam(1, _returned_refit_capacity); |
349 SetDParam(2, cost); |
349 SetDParam(2, cost); |
350 DrawString(2, w->widget[5].top + 1, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); |
350 DrawString(2, w->widget[5].top + 1, STR_9840_NEW_CAPACITY_COST_OF_REFIT, 0); |
351 } |
351 } |