From 3b2e917ca4547e1abdd6e8e19ee5467bb9bf1f5d Mon Sep 17 00:00:00 2001
From: Jonathan G Rennison
Note: Using temporary variable 0x100 as the offset should be used with caution.
This variable is also enabled for ships if indicated by the feature name: multi_part_ships, version 2.
+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(), };