summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalied K. Yassen <walied.developer@hotmail.com>2020-11-29 07:52:43 +0100
committerWalied K. Yassen <walied.developer@hotmail.com>2020-11-29 07:53:54 +0100
commitafe70003f4c48683c287ca3d16662cc710f8602e (patch)
tree6e1aa717ef537bbc23bb8a3217698246b82a180e
parentFix CObject::DeleteAllTempObjectsInArea not considering the given point (diff)
downloadre3-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 '')
-rw-r--r--src/objects/Object.cpp10
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