diff --git a/SilentPatchSA/GeneralSA.cpp b/SilentPatchSA/GeneralSA.cpp index 7c09bc8..5a55ce5 100644 --- a/SilentPatchSA/GeneralSA.cpp +++ b/SilentPatchSA/GeneralSA.cpp @@ -48,6 +48,15 @@ RpAtomic* ShadowCameraRenderCB(RpAtomic* pAtomic) return pAtomic; } +void CEntity::SetPositionAndAreaCode( CVector position ) +{ + SetCoords( position ); + if ( position.z >= 950.0f ) + { + m_areaCode = 13; + } +} + void CObject::Render() { if ( m_bDoNotRender || !m_pRwObject ) diff --git a/SilentPatchSA/GeneralSA.h b/SilentPatchSA/GeneralSA.h index cb680c2..6f070c9 100644 --- a/SilentPatchSA/GeneralSA.h +++ b/SilentPatchSA/GeneralSA.h @@ -199,6 +199,8 @@ public: uint8_t GetStatus() const { return nStatus; } bool IsVisible(); + + void SetPositionAndAreaCode( CVector position ); }; class NOVMT CPhysical : public CEntity diff --git a/SilentPatchSA/SilentPatchSA.cpp b/SilentPatchSA/SilentPatchSA.cpp index b349145..272f3e9 100644 --- a/SilentPatchSA/SilentPatchSA.cpp +++ b/SilentPatchSA/SilentPatchSA.cpp @@ -3978,6 +3978,10 @@ void Patch_SA_10() Patch( 0x5B9868 + 2, &pAudioUtilsFrequency ); InjectHook( 0x5B9886, AudioUtilsGetStartTime ); InjectHook( 0x4D9E80, AudioUtilsGetCurrentTimeInMs, PATCH_JUMP ); + + + // Car generators placed in interiors visible everywhere + InjectHook( 0x6F3B30, &CEntity::SetPositionAndAreaCode ); } void Patch_SA_11()