Multi-part ships: Require feature test to enable callback 16
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user