Cargens placed in interiors tie to area 13 (visible everywhere)

This commit is contained in:
Silent 2017-09-23 21:04:46 +02:00
parent e272cce1f3
commit a66876f85f
3 changed files with 15 additions and 0 deletions

View File

@ -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 )

View File

@ -199,6 +199,8 @@ public:
uint8_t GetStatus() const { return nStatus; }
bool IsVisible();
void SetPositionAndAreaCode( CVector position );
};
class NOVMT CPhysical : public CEntity

View File

@ -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()