(svn r7326) -Feature: Add support for gradual (un)loading of vehicles (Maedhros)

This commit is contained in:
peter1138
2006-12-02 16:56:32 +00:00
parent 71642d464b
commit acac44820b
16 changed files with 155 additions and 86 deletions

View File

@@ -273,9 +273,10 @@ static void HandleShipLoading(Vehicle *v)
if (v->current_order.type != OT_LOADING) return;
if (--v->load_unload_time_rem) return;
if (v->current_order.flags & OF_FULL_LOAD && CanFillVehicle(v)) {
if (CanFillVehicle(v) && (v->current_order.flags & OF_FULL_LOAD ||
(_patches.gradual_loading && !HASBIT(v->load_status, LS_LOADING_FINISHED)))) {
SET_EXPENSES_TYPE(EXPENSES_SHIP_INC);
if (LoadUnloadVehicle(v)) {
if (LoadUnloadVehicle(v, false)) {
InvalidateWindow(WC_SHIPS_LIST, v->owner);
MarkShipDirty(v);
}
@@ -705,7 +706,7 @@ static void ShipController(Vehicle *v)
ShipArrivesAt(v, st);
SET_EXPENSES_TYPE(EXPENSES_SHIP_INC);
if (LoadUnloadVehicle(v)) {
if (LoadUnloadVehicle(v, true)) {
InvalidateWindow(WC_SHIPS_LIST, v->owner);
MarkShipDirty(v);
}