[Scummvm-git-logs] scummvm master -> 4dfeb2703687fce736ee5852b9bee3240e9a52bf
grisenti
noreply at scummvm.org
Fri Dec 15 14:56:34 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4dfeb27036 HPL1: Remove null pointer check
Commit: 4dfeb2703687fce736ee5852b9bee3240e9a52bf
https://github.com/scummvm/scummvm/commit/4dfeb2703687fce736ee5852b9bee3240e9a52bf
Author: grisenti (emanuele at grisenti.net)
Date: 2023-12-15T15:56:25+01:00
Commit Message:
HPL1: Remove null pointer check
The pointer is dereferenced in the above statements, making this check useless.
Changed paths:
engines/hpl1/penumbra-overture/Player.cpp
diff --git a/engines/hpl1/penumbra-overture/Player.cpp b/engines/hpl1/penumbra-overture/Player.cpp
index d3c35d1f4f8..c1d72d38cf5 100644
--- a/engines/hpl1/penumbra-overture/Player.cpp
+++ b/engines/hpl1/penumbra-overture/Player.cpp
@@ -1137,21 +1137,19 @@ void cPlayer::Update(float afTimeStep) {
// LogUpdate(" took %d ms\n",pSystem->GetLowLevel()->GetTime() - lTime);
// lTime = pSystem->GetLowLevel()->getTime();
// LogUpdate(" Camera pos\n");
- if (mpCharBody) {
- float fYAdd = mfCameraHeightAdd + mpHeadMove->GetPos() + mfHeightAdd + mpDeath->GetHeighAdd() +
- mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().y;
+ float fYAdd = mfCameraHeightAdd + mpHeadMove->GetPos() + mfHeightAdd + mpDeath->GetHeighAdd() +
+ mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().y;
- cVector3f vRight = mpCharBody->GetRight();
- float fXAdd = mpLean->mfMovement * vRight.x +
- mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().x;
+ cVector3f vRight = mpCharBody->GetRight();
+ float fXAdd = mpLean->mfMovement * vRight.x +
+ mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().x;
- float fZAdd = mpLean->mfMovement * vRight.z +
- mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().x;
+ float fZAdd = mpLean->mfMovement * vRight.z +
+ mpInit->mpEffectHandler->GetShakeScreen()->GetScreenAdd().x;
- // Log("HEadMove: %f HeightAdd %f Death: %f\n",mpHeadMove->GetPos(),mfHeightAdd,mpDeath->GetHeighAdd());
+ // Log("HEadMove: %f HeightAdd %f Death: %f\n",mpHeadMove->GetPos(),mfHeightAdd,mpDeath->GetHeighAdd());
- mpCharBody->SetCameraPosAdd(cVector3f(fXAdd, fYAdd, fZAdd));
- }
+ mpCharBody->SetCameraPosAdd(cVector3f(fXAdd, fYAdd, fZAdd));
///////////////////////////
// Update state
More information about the Scummvm-git-logs
mailing list