mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-12 18:40:29 +00:00
(svn r24029) -Change: [NoAI] make AIEngine::IsArticulated return true if the articulated callback flag is set, don't try to run the callback.
This commit is contained in:
parent
c7ae0b4db6
commit
1f0593e7ca
@ -54,6 +54,16 @@ static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle
|
|||||||
return GetNewEngineID(front_engine->GetGRF(), front_engine->type, callback);
|
return GetNewEngineID(front_engine->GetGRF(), front_engine->type, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does a NewGRF report that this should be an articulated vehicle?
|
||||||
|
* @param engine_type The engine to check.
|
||||||
|
* @return True iff the articulated engine callback flag is set.
|
||||||
|
*/
|
||||||
|
bool IsArticulatedEngine(EngineID engine_type)
|
||||||
|
{
|
||||||
|
return HasBit(EngInfo(engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Count the number of articulated parts of an engine.
|
* Count the number of articulated parts of an engine.
|
||||||
* @param engine_type The engine to get the number of parts of.
|
* @param engine_type The engine to get the number of parts of.
|
||||||
|
@ -23,6 +23,7 @@ uint32 GetUnionOfArticulatedRefitMasks(EngineID engine, bool include_initial_car
|
|||||||
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
|
uint32 GetIntersectionOfArticulatedRefitMasks(EngineID engine, bool include_initial_cargo_type);
|
||||||
bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type);
|
bool IsArticulatedVehicleCarryingDifferentCargoes(const Vehicle *v, CargoID *cargo_type);
|
||||||
bool IsArticulatedVehicleRefittable(EngineID engine);
|
bool IsArticulatedVehicleRefittable(EngineID engine);
|
||||||
|
bool IsArticulatedEngine(EngineID engine_type);
|
||||||
void CheckConsistencyOfArticulatedVehicle(const Vehicle *v);
|
void CheckConsistencyOfArticulatedVehicle(const Vehicle *v);
|
||||||
|
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@
|
|||||||
if (!IsValidEngine(engine_id)) return false;
|
if (!IsValidEngine(engine_id)) return false;
|
||||||
if (GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD && GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
|
if (GetVehicleType(engine_id) != ScriptVehicle::VT_ROAD && GetVehicleType(engine_id) != ScriptVehicle::VT_RAIL) return false;
|
||||||
|
|
||||||
return CountArticulatedParts(engine_id, true) != 0;
|
return IsArticulatedEngine(engine_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ ScriptAirport::PlaneType ScriptEngine::GetPlaneType(EngineID engine_id)
|
/* static */ ScriptAirport::PlaneType ScriptEngine::GetPlaneType(EngineID engine_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user