@@ -77,21 +77,6 @@ bool CWorldSA::ResetSurfaceInfo(short sSurfaceID)
7777 return false ;
7878}
7979
80- CEntity* CWorldSA::TestSphereAgainstWorld (const CVector& sphereCenter, float radius, CEntity* ignoredEntity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool cameraIgnore, STestSphereAgainstWorldResult& result)
81- {
82- auto entity = ((CEntitySAInterface*(__cdecl*)(CVector, float , CEntitySAInterface*, bool , bool , bool , bool , bool , bool ))FUNC_CWorld_TestSphereAgainstWorld)(sphereCenter, radius, ignoredEntity ? ignoredEntity->GetInterface () : nullptr , checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, cameraIgnore);
83- if (!entity)
84- return nullptr ;
85-
86- result.collisionDetected = true ;
87- result.hitPosition = entity->Placeable .matrix ->vPos ;
88- result.modelID = entity->m_nModelIndex ;
89- result.type = entity->nType ;
90- result.lodID = entity->m_pLod ? entity->m_pLod ->m_nModelIndex : 0 ;
91-
92- return pGame->GetPools ()->GetEntity (reinterpret_cast <DWORD*>(entity));
93- }
94-
9580void HOOK_FallenPeds ();
9681void HOOK_FallenCars ();
9782
@@ -543,6 +528,23 @@ bool CWorldSA::ProcessLineOfSight(const CVector* vecStart, const CVector* vecEnd
543528 return bReturn;
544529}
545530
531+ CEntity* CWorldSA::TestSphereAgainstWorld (const CVector& sphereCenter, float radius, CEntity* ignoredEntity, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool cameraIgnore, STestSphereAgainstWorldResult& result)
532+ {
533+ auto entity = ((CEntitySAInterface*(__cdecl*)(CVector, float , CEntitySAInterface*, bool , bool , bool , bool , bool , bool ))FUNC_CWorld_TestSphereAgainstWorld)(sphereCenter, radius, ignoredEntity ? ignoredEntity->GetInterface () : nullptr , checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, cameraIgnore);
534+ if (!entity)
535+ return nullptr ;
536+
537+ result.collisionDetected = true ;
538+ result.modelID = entity->m_nModelIndex ;
539+ result.entityPosition = entity->Placeable .matrix ->vPos ;
540+ ConvertMatrixToEulerAngles (*entity->Placeable .matrix , result.entityRotation .fX , result.entityRotation .fY , result.entityRotation .fZ );
541+ result.entityRotation = -result.entityRotation ;
542+ result.lodID = entity->m_pLod ? entity->m_pLod ->m_nModelIndex : 0 ;
543+ result.type = entity->nType ;
544+
545+ return pGame->GetPools ()->GetEntity (reinterpret_cast <DWORD*>(entity));
546+ }
547+
546548void CWorldSA::IgnoreEntity (CEntity* pEntity)
547549{
548550 CEntitySA* pEntitySA = dynamic_cast <CEntitySA*>(pEntity);
0 commit comments