diff --git a/docs/newgrf-additions.html b/docs/newgrf-additions.html index 5c86bae574..412e09bc24 100644 --- a/docs/newgrf-additions.html +++ b/docs/newgrf-additions.html @@ -48,6 +48,7 @@
  • Action 0 - Objects
  • Action 14 - Variable Mapping for Variational Action 2
  • Variational Action 2 - Additional Types
  • +
  • Variational Action 2 - Vehicles
  • Variational Action 2 - Stations
  • Variational Action 2 - Railtypes
  • Variational Action 2 - Objects
  • @@ -779,6 +780,10 @@ Bit 7 of the mode byte must be set to use temporary variable 0x100 instead.

    Note: Using temporary variable 0x100 as the offset should be used with caution.


    +

    Variational Action 2 - Vehicles

    +

    Query variable of n-th vehicle in chain (61)

    +

    This variable is also enabled for ships if indicated by the feature name: multi_part_ships, version 2.

    +

    Variational Action 2 - Stations

    Track type in purchase list (42)

    This is indicated by the feature name: varaction2_station_var42, version 1

    diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index b62e6782a5..9a8dc415b9 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -772,7 +772,7 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, } case 0x61: // Get variable of n-th vehicle in chain [signed number relative to vehicle] - if (!v->IsGroundVehicle() || parameter == 0x61) { + if (!(v->IsGroundVehicle() || v->type == VEH_SHIP) || parameter == 0x61) { /* Not available */ break; } diff --git a/src/newgrf_extension.cpp b/src/newgrf_extension.cpp index d60466df5a..c6584700b2 100644 --- a/src/newgrf_extension.cpp +++ b/src/newgrf_extension.cpp @@ -70,7 +70,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = { GRFFeatureInfo("town_zone_callback", 1, GFTOF_TOWN_ZONE_CALLBACK), GRFFeatureInfo("varaction2_towns_town_xy", 1), GRFFeatureInfo("more_varaction2_types", 1, GFTOF_MORE_VARACTION2_TYPES), - GRFFeatureInfo("multi_part_ships", 1, GFTOF_MULTI_PART_SHIPS), + GRFFeatureInfo("multi_part_ships", 2, GFTOF_MULTI_PART_SHIPS), GRFFeatureInfo("more_stations_per_grf", 1), GRFFeatureInfo(), };