@@ -156,14 +156,7 @@ void CMultiplayerSA::SetNightVisionEnabled(bool bEnabled, bool bNoiseEnabled)
156156
157157void CMultiplayerSA::SetUnderwaterEffectEnabled (bool bEnabled)
158158{
159- if (bEnabled)
160- {
161- MemPutFast<BYTE>(0xC402D3 , 1 );
162- }
163- else
164- {
165- MemPutFast<BYTE>(0xC402D3 , 0 );
166- }
159+ MemPutFast<BYTE>(0xC402D3 , bEnabled ? 1 : 0 );
167160}
168161
169162void CMultiplayerSA::SetUnderwaterEffectSpeed (float fSpeed , float fFrequency )
@@ -174,14 +167,7 @@ void CMultiplayerSA::SetUnderwaterEffectSpeed(float fSpeed, float fFrequency)
174167
175168void CMultiplayerSA::SetUnderwaterDarkness (bool bEnabled, float fFullDarknessDepth )
176169{
177- if (bEnabled)
178- {
179- MemPutFast<BYTE>(0x8D5144 , 1 );
180- }
181- else
182- {
183- MemPutFast<BYTE>(0x8D5144 , 0 );
184- }
170+ MemPutFast<BYTE>(0x8D5144 , bEnabled ? 1 : 0 );
185171
186172 MemPutFast<float >(0x8D5148 , fFullDarknessDepth );
187173}
@@ -218,7 +204,7 @@ bool CMultiplayerSA::IsThermalVisionEnabled()
218204
219205std::tuple<bool , float , float > CMultiplayerSA::GetUnderwaterEffect ()
220206{
221- bool bEnabled = (*(BYTE*)0xC402D3 == 1 );
207+ bool bEnabled = (*(BYTE*)0xC402D3 == 1 ) || (*( float *) 0xC8132C ) >= 0 . 535f ;
222208 float fSpeed = (*(float *)0x8D5138 );
223209 float fFrequency = (*(float *)0x8D513C );
224210
@@ -235,7 +221,7 @@ std::tuple<bool, float> CMultiplayerSA::GetUnderwaterDarkness()
235221}
236222
237223void CMultiplayerSA::InitHooks_Postprocess ()
238- {
224+ {
239225 HookInstallCall (HOOKPOS_GrainEffect_NightModifier, (DWORD)GrainEffect::NightModifier::ApplyEffect);
240226 HookInstallCall (HOOKPOS_GrainEffect_InfraredModifier, (DWORD)GrainEffect::InfraredModifier::ApplyEffect);
241227 HookInstallCall (HOOKPOS_GrainEffect_RainModifier, (DWORD)GrainEffect::RainModifier::ApplyEffect);
0 commit comments