Planes don't need ResetFrames() so they got a separate method

This commit is contained in:
Silent 2014-08-12 22:43:17 +02:00
parent 0b8cfdd7db
commit e44a901a27
3 changed files with 16 additions and 3 deletions

View file

@ -1430,7 +1430,7 @@ __forceinline void Patch_SA_10()
// but not on Vortex
Patch<BYTE>(0x6CABD0, 0xEB);
Patch<DWORD>(0x6CAC05, 0x5E5FCF8B);
InjectHook(0x6CAC09, &CAutomobile::Fix_SilentPatch, PATCH_JUMP);
InjectHook(0x6CAC09, &CPlane::Fix_SilentPatch, PATCH_JUMP);
// Zones fix

View file

@ -220,6 +220,18 @@ void CPlane::Render()
CVehicle::Render();
}
void CPlane::Fix_SilentPatch()
{
// Reset bouncing panels
for ( int i = 0; i < 3; i++ )
{
// No reset on Vortex
if ( i == 0 && m_nModelIndex == 539 )
continue;
m_aBouncingPanel[i].m_nNodeIndex = -1;
}
}
void CAutomobile::Fix_SilentPatch()
{
ResetFrames();
@ -228,8 +240,7 @@ void CAutomobile::Fix_SilentPatch()
for ( int i = 0; i < 3; i++ )
{
// Towtruck/Tractor fix
// + no reset on Vortex
if ( i == 0 && ((m_nModelIndex == 525 && m_pCarNode[21]) || (m_nModelIndex == 531 && m_pCarNode[17]) || m_nModelIndex == 539) )
if ( i == 0 && ((m_nModelIndex == 525 && m_pCarNode[21]) || (m_nModelIndex == 531 && m_pCarNode[17])) )
continue;
m_aBouncingPanel[i].m_nNodeIndex = -1;
}

View file

@ -164,6 +164,8 @@ public:
{ CPlane::Render(); }
virtual void Render() override;
void Fix_SilentPatch();
};
static_assert(sizeof(CBouncingPanel) == 0x20, "Wrong size: CBouncingPanel");