mirror of https://github.com/OpenTTD/OpenTTD
(svn r25498) [1.3] -Backport from trunk:
- Fix: [NewGRF] When cargo NewGRF define a multiplier to modify vehicle capacities, use the same multiplier to modify loading speed (r25497, r25479) - Fix: [OSX] OS X SDK versions >= 10.5 always have a non-const iconv declaration (r25480) - Fix: Disable the depot-refit button in the order GUI, if the consist is not refittable unless it already has a refit order (r25459, r25458, r25457)release/1.3
parent
fab048a116
commit
c62e867b56
|
@ -1754,7 +1754,7 @@ make_cflags_and_ldflags() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ "$have_non_const_iconv" != "no" ]; then
|
||||
if [ "$os" != "OSX" ] && [ "$have_non_const_iconv" != "no" ]; then
|
||||
CFLAGS="$CFLAGS -DHAVE_NON_CONST_ICONV"
|
||||
fi
|
||||
fi
|
||||
|
@ -3488,7 +3488,7 @@ generate_src_osx() {
|
|||
CFLAGS="-isysroot $osx_sdk_path $CFLAGS_orig"
|
||||
LDFLAGS="-Wl,-syslibroot,$osx_sdk_path $LDFLAGS_orig"
|
||||
fi
|
||||
CFLAGS="$CFLAGS -D_SQ64 -DHAVE_NON_CONST_ICONV -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
|
||||
CFLAGS="$CFLAGS -D_SQ64 -DNO_QUICKTIME -UENABLE_COCOA_QUICKDRAW"
|
||||
LIBS="`echo $LIBS | sed 's/-framework QuickTime//'`"
|
||||
fi
|
||||
|
||||
|
|
|
@ -1313,10 +1313,11 @@ static void LoadUnloadVehicle(Vehicle *front, int *cargo_left)
|
|||
artic_part++;
|
||||
|
||||
const Engine *e = v->GetEngine();
|
||||
byte load_amount = e->info.load_amount;
|
||||
uint load_amount = e->info.load_amount;
|
||||
|
||||
/* The default loadamount for mail is 1/4 of the load amount for passengers */
|
||||
if (v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft()) load_amount = CeilDiv(load_amount, 4);
|
||||
bool air_mail = v->type == VEH_AIRCRAFT && !Aircraft::From(v)->IsNormalAircraft();
|
||||
if (air_mail) load_amount = CeilDiv(load_amount, 4);
|
||||
|
||||
if (_settings_game.order.gradual_loading) {
|
||||
uint16 cb_load_amount = CALLBACK_FAILED;
|
||||
|
@ -1337,6 +1338,9 @@ static void LoadUnloadVehicle(Vehicle *front, int *cargo_left)
|
|||
}
|
||||
}
|
||||
|
||||
/* Scale load amount the same as capacity */
|
||||
if (HasBit(e->info.misc_flags, EF_NO_DEFAULT_CARGO_MULTIPLIER) && !air_mail) load_amount = CeilDiv(load_amount * CargoSpec::Get(v->cargo_type)->multiplier, 0x100);
|
||||
|
||||
GoodsEntry *ge = &st->goods[v->cargo_type];
|
||||
|
||||
if (HasBit(v->vehicle_flags, VF_CARGO_UNLOADING) && (front->current_order.GetUnloadType() & OUFB_NO_UNLOAD) == 0) {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "core/geometry_func.hpp"
|
||||
#include "hotkeys.h"
|
||||
#include "aircraft.h"
|
||||
#include "engine_func.h"
|
||||
|
||||
#include "widgets/order_widget.h"
|
||||
|
||||
|
@ -518,6 +519,7 @@ private:
|
|||
OrderPlaceObjectState goto_type;
|
||||
const Vehicle *vehicle; ///< Vehicle owning the orders being displayed and manipulated.
|
||||
Scrollbar *vscroll;
|
||||
bool can_do_refit; ///< Vehicle chain can be refitted in depot.
|
||||
bool can_do_autorefit; ///< Vehicle chain can be auto-refitted.
|
||||
|
||||
/**
|
||||
|
@ -786,8 +788,10 @@ private:
|
|||
/** Cache auto-refittability of the vehicle chain. */
|
||||
void UpdateAutoRefitState()
|
||||
{
|
||||
this->can_do_refit = false;
|
||||
this->can_do_autorefit = false;
|
||||
for (const Vehicle *w = this->vehicle; w != NULL; w = w->Next()) {
|
||||
for (const Vehicle *w = this->vehicle; w != NULL; w = w->IsGroundVehicle() ? w->Next() : NULL) {
|
||||
if (IsEngineRefittable(w->engine_type)) this->can_do_refit = true;
|
||||
if (HasBit(Engine::Get(w->engine_type)->info.misc_flags, EF_AUTO_REFIT)) this->can_do_autorefit = true;
|
||||
}
|
||||
}
|
||||
|
@ -1014,8 +1018,11 @@ public:
|
|||
this->SetWidgetLoweredState(WID_O_FULL_LOAD, order->GetLoadType() == OLF_FULL_LOAD_ANY);
|
||||
this->SetWidgetLoweredState(WID_O_UNLOAD, order->GetUnloadType() == OUFB_UNLOAD);
|
||||
|
||||
/* Can only do refitting when stopping at the destination and loading cargo. */
|
||||
this->SetWidgetDisabledState(WID_O_REFIT_DROPDOWN, !this->can_do_autorefit || order->GetLoadType() == OLFB_NO_LOAD || order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION);
|
||||
/* Can only do refitting when stopping at the destination and loading cargo.
|
||||
* Also enable the button if a refit is already set to allow clearing it. */
|
||||
this->SetWidgetDisabledState(WID_O_REFIT_DROPDOWN,
|
||||
order->GetLoadType() == OLFB_NO_LOAD || (order->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION) ||
|
||||
((!this->can_do_refit || !this->can_do_autorefit) && !order->IsRefit()));
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1048,7 +1055,9 @@ public:
|
|||
}
|
||||
/* Disable refit button if the order is no 'always go' order.
|
||||
* However, keep the service button enabled for refit-orders to allow clearing refits (without knowing about ctrl). */
|
||||
this->SetWidgetDisabledState(WID_O_REFIT, (order->GetDepotOrderType() & ODTFB_SERVICE) || (order->GetDepotActionType() & ODATFB_HALT));
|
||||
this->SetWidgetDisabledState(WID_O_REFIT,
|
||||
(order->GetDepotOrderType() & ODTFB_SERVICE) || (order->GetDepotActionType() & ODATFB_HALT) ||
|
||||
(!this->can_do_refit && !order->IsRefit()));
|
||||
this->SetWidgetLoweredState(WID_O_SERVICE, order->GetDepotOrderType() & ODTFB_SERVICE);
|
||||
break;
|
||||
|
||||
|
|
|
@ -75,4 +75,9 @@ typedef unsigned int NSUInteger;
|
|||
#endif /* __LP64__ */
|
||||
#endif /* NSInteger */
|
||||
|
||||
/* OS X SDK versions >= 10.5 have a non-const iconv. */
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
||||
# define HAVE_NON_CONST_ICONV
|
||||
#endif
|
||||
|
||||
#endif /* MACOS_STDAFX_H */
|
||||
|
|
Loading…
Reference in New Issue