Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(w3ddevice): hold camera shake at MaxShakeIntensity

Olcay Seygan0fe7fe4b33b9
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
index 79169e629..89f45964c 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
@@ -3997,10 +3997,10 @@ void W3DView::shake( const Coord3D *epicenter, CameraShakeType shakeType )
// add intensity and clamp
m_shakeIntensity += intensity;
- //const Real maxIntensity = 10.0f;
- const Real maxIntensity = 3.0f;
+ // Held at the ceiling. EA's line put it back to 3.0 once the sum passed MaxShakeIntensity, so
+ // the hit that took a barrage over the top shook the camera less than the one before it.
if (m_shakeIntensity > TheGlobalData->m_maxShakeIntensity)
- m_shakeIntensity = maxIntensity;
+ m_shakeIntensity = TheGlobalData->m_maxShakeIntensity;
}
//-------------------------------------------------------------------------------------------------