[saco] Implement and match IsATrainPart(...)

This commit is contained in:
RD42 2024-05-06 22:32:46 +08:00
parent 6b2e018270
commit 282a3c88f6
2 changed files with 18 additions and 0 deletions

View File

@ -1471,6 +1471,23 @@ bool HasCollisionLoaded(VECTOR *vec)
//---------------------------------------------------- //----------------------------------------------------
DWORD dwEntityModelIndex;
BOOL __stdcall IsATrainPart(ENTITY_TYPE *pEntity)
{
int nModel;
if(pEntity) {
nModel = pEntity->nModelIndex;
dwEntityModelIndex = pEntity->nModelIndex;
if(nModel == TRAIN_FREIGHT_LOCO) return TRUE;
if(nModel == TRAIN_FREIGHT) return TRUE;
if(nModel == TRAIN_PASSENGER_LOCO) return TRUE;
if(nModel == TRAIN_PASSENGER) return TRUE;
if(nModel == TRAIN_TRAM) return TRUE;
}
return FALSE;
}
float DegToRad(float fDegrees) float DegToRad(float fDegrees)
{ {

View File

@ -49,3 +49,4 @@ void ReplaceBuildingModel(ENTITY_TYPE *pEntity, int iModelID);
int GetInvalidModelInfoCount(); int GetInvalidModelInfoCount();
bool HasCollisionLoaded(VECTOR *vec); bool HasCollisionLoaded(VECTOR *vec);
BOOL __stdcall IsATrainPart(ENTITY_TYPE *pEntity);