Multi-part ships: Require feature test to enable callback 16

This commit is contained in:
Jonathan G Rennison
2023-03-15 22:36:27 +00:00
parent 87e4258fe3
commit 8cd7c9559f
4 changed files with 9 additions and 2 deletions

View File

@@ -15,6 +15,7 @@
#include "engine_func.h"
#include "company_func.h"
#include "newgrf.h"
#include "newgrf_extension.h"
#include <vector>
#include "table/strings.h"
@@ -37,6 +38,10 @@ static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle
const Engine *front_engine = Engine::Get(front_type);
if (front_engine->type == VEH_SHIP && !(front_engine->GetGRF() != nullptr && HasBit(front_engine->GetGRF()->observed_feature_tests, GFTOF_MULTI_PART_SHIPS))) {
return INVALID_ENGINE;
}
uint16 callback = GetVehicleCallback(CBID_VEHICLE_ARTIC_ENGINE, index, 0, front_type, front);
if (callback == CALLBACK_FAILED) return INVALID_ENGINE;