diff options
author | Walied K. Yassen <walied.developer@hotmail.com> | 2020-11-29 07:52:43 +0100 |
---|---|---|
committer | Walied K. Yassen <walied.developer@hotmail.com> | 2020-11-29 07:53:54 +0100 |
commit | afe70003f4c48683c287ca3d16662cc710f8602e (patch) | |
tree | 6e1aa717ef537bbc23bb8a3217698246b82a180e /src/objects/Object.cpp | |
parent | Fix CObject::DeleteAllTempObjectsInArea not considering the given point (diff) | |
download | re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar.gz re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar.bz2 re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar.lz re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar.xz re3-afe70003f4c48683c287ca3d16662cc710f8602e.tar.zst re3-afe70003f4c48683c287ca3d16662cc710f8602e.zip |
Diffstat (limited to 'src/objects/Object.cpp')
-rw-r--r-- | src/objects/Object.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/objects/Object.cpp b/src/objects/Object.cpp index 2319c0d9..9322418f 100644 --- a/src/objects/Object.cpp +++ b/src/objects/Object.cpp @@ -107,7 +107,8 @@ CObject::ProcessControl(void) m_vecMoveSpeed *= fTimeStep; m_vecTurnSpeed *= fTimeStep; } - if ((GetModelIndex() == MI_EXPLODINGBARREL || GetModelIndex() == MI_PETROLPUMP) && bHasBeenDamaged && bIsVisible + auto mi = GetModelIndex(); + if ((mi == MI_EXPLODINGBARREL || mi == MI_PETROLPUMP || mi == MI_PETROLPUMP2) && bHasBeenDamaged && bIsVisible && (CGeneral::GetRandomNumber() & 0x1F) == 10) { bExplosionProof = true; bIsVisible = false; @@ -115,6 +116,13 @@ CObject::ProcessControl(void) bAffectedByGravity = false; m_vecMoveSpeed = CVector(0.0f, 0.0f, 0.0f); } + if (mi == MI_RCBOMB) { + float fTurnForce = -(m_fTurnMass / 20.0f); + CPhysical::ApplyTurnForce(m_vecMoveSpeed * fTurnForce, -GetForward()); + float fScalar = 1.0f - m_vecMoveSpeed.MagnitudeSqr() / 5.0f; + float fScalarTimed = Pow(fScalar, CTimer::GetTimeStep()); + m_vecMoveSpeed *= fScalarTimed; + } } void |