@@ -559,7 +559,6 @@ void HOOK_CObject_ProcessBreak();
559
559
void HOOK_CObject_ProcessCollision ();
560
560
void HOOK_CGlass_WindowRespondsToCollision ();
561
561
void HOOK_CGlass__BreakGlassPhysically ();
562
- void HOOK_CGlass_WindowRespondsToExplosion (); // get attacker & object
563
562
564
563
void HOOK_FxManager_c__DestroyFxSystem ();
565
564
@@ -754,7 +753,6 @@ void CMultiplayerSA::InitHooks()
754
753
HookInstall (HOOKPOS_CObject_ProcessCollision, (DWORD)HOOK_CObject_ProcessCollision, 10 );
755
754
HookInstall (HOOKPOS_CGlass_WindowRespondsToCollision, (DWORD)HOOK_CGlass_WindowRespondsToCollision, 8 );
756
755
HookInstall (HOOKPOS_CGlass__BreakGlassPhysically, (DWORD)HOOK_CGlass__BreakGlassPhysically, 5 );
757
- HookInstall (HOOKPOS_CGlass_WindowRespondsToExplosion, (DWORD)HOOK_CGlass_WindowRespondsToExplosion, 5 );
758
756
759
757
// Post-destruction hook for FxSystems
760
758
HookInstall (HOOKPOS_FxManager_c__DestroyFxSystem, (DWORD)HOOK_FxManager_c__DestroyFxSystem, 5 );
@@ -6827,6 +6825,8 @@ void _declspec(naked) HOOK_CGlass_WindowRespondsToCollision()
6827
6825
pop eax
6828
6826
}
6829
6827
6828
+ pObjectAttacker = nullptr ;
6829
+
6830
6830
if (WindowRespondsToCollision_CalledFrom != CALL_FROM_CGlass_WindowRespondsToExplosion)
6831
6831
{
6832
6832
_asm
@@ -6836,45 +6836,42 @@ void _declspec(naked) HOOK_CGlass_WindowRespondsToCollision()
6836
6836
}
6837
6837
6838
6838
// Get attacker for the glass break
6839
- switch (WindowRespondsToCollision_CalledFrom)
6839
+ if (WindowRespondsToCollision_CalledFrom == CALL_FROM_CPhysical_ApplyCollision ||
6840
+ WindowRespondsToCollision_CalledFrom == CALL_FROM_CPhysical_ApplyCollision_2 ||
6841
+ WindowRespondsToCollision_CalledFrom == CALL_FROM_CPhysical_ApplySoftCollision)
6840
6842
{
6841
- case CALL_FROM_CPhysical_ApplyCollision:
6842
- case CALL_FROM_CPhysical_ApplyCollision_2:
6843
- case CALL_FROM_CPhysical_ApplySoftCollision:
6843
+ _asm
6844
6844
{
6845
- _asm
6846
- {
6847
- mov pObjectAttacker, edi
6848
- }
6845
+ mov pObjectAttacker, edi
6846
+ }
6847
+ }
6849
6848
6850
- break ;
6849
+ if (WindowRespondsToCollision_CalledFrom == CALL_FROM_CGlass_WasGlassHitByBullet)
6850
+ {
6851
+ _asm
6852
+ {
6853
+ mov pObjectAttacker, ebx // WasGlassHitByBullet called from CWeapon::DoBulletImpact
6851
6854
}
6852
- case CALL_FROM_CGlass_WasGlassHitByBullet:
6855
+
6856
+ if (!pObjectAttacker || (pObjectAttacker && !pObjectAttacker->m_pRwObject )) // WasGlassHitByBullet called from CBulletInfo::Update
6853
6857
{
6854
6858
_asm
6855
6859
{
6856
- mov pObjectAttacker, ebx // WasGlassHitByBullet called from CWeapon::DoBulletImpact
6860
+ push ecx
6861
+ mov ecx, [edi]
6862
+ mov pObjectAttacker, ecx
6863
+ pop ecx
6857
6864
}
6858
-
6859
- if (!pObjectAttacker || (pObjectAttacker && !pObjectAttacker->m_pRwObject )) // WasGlassHitByBullet called from CBulletInfo::Update
6860
- {
6861
- _asm
6862
- {
6863
- push ecx
6864
- mov ecx, [edi]
6865
- mov pObjectAttacker, ecx
6866
- pop ecx
6867
- }
6868
- }
6869
-
6870
- break ;
6871
6865
}
6872
- case CALL_FROM_CGlass_WindowRespondsToExplosion:
6866
+ }
6867
+
6868
+ if (WindowRespondsToCollision_CalledFrom == CALL_FROM_CGlass_WindowRespondsToExplosion)
6869
+ {
6870
+ _asm
6873
6871
{
6874
- break ;
6872
+ mov pDamagedObject, edx
6873
+ mov pObjectAttacker, ebp
6875
6874
}
6876
- default :
6877
- pObjectAttacker = nullptr ;
6878
6875
}
6879
6876
6880
6877
if (pObjectAttacker && !pObjectAttacker->m_pRwObject ) // Still wrong?
@@ -6936,17 +6933,6 @@ void _declspec(naked) HOOK_CGlass__BreakGlassPhysically()
6936
6933
}
6937
6934
}
6938
6935
6939
- void _declspec (naked) HOOK_CGlass_WindowRespondsToExplosion()
6940
- {
6941
- _asm {
6942
- push 1
6943
- sub esp, 0Ch
6944
- mov pDamagedObject, edx
6945
- mov pObjectAttacker, ebp
6946
- jmp RETURN_CGlass_WindowRespondsToExplosion
6947
- }
6948
- }
6949
-
6950
6936
void * pFxSystemToBeDestroyed;
6951
6937
void FxManager_c__DestroyFxSystem ()
6952
6938
{
0 commit comments