summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-08-31 20:21:50 +0200
committerSergeanur <s.anureev@yandex.ua>2020-08-31 20:21:50 +0200
commitdf67c73d81c6ce9f6922b7fad23d69232b9e19fd (patch)
treecf39c9d29d693795738c7338eef38984a68dba09 /src
parentuse SetOrientation (diff)
downloadre3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar.gz
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar.bz2
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar.lz
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar.xz
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.tar.zst
re3-df67c73d81c6ce9f6922b7fad23d69232b9e19fd.zip
Diffstat (limited to 'src')
-rw-r--r--src/objects/Stinger.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/objects/Stinger.cpp b/src/objects/Stinger.cpp
index 7a84edac..61424885 100644
--- a/src/objects/Stinger.cpp
+++ b/src/objects/Stinger.cpp
@@ -188,14 +188,14 @@ CStinger::Process()
// no break
case STINGERSTATE_STATE1:
if (m_nSpikeState != STINGERSTATE_STATE1 || CTimer::GetTimeInMilliseconds() <= m_nTimeOfDeploy + 2500) {
- float something = (CTimer::GetTimeInMilliseconds() - m_nTimeOfDeploy) / 2500.0f;
+ float progress = (CTimer::GetTimeInMilliseconds() - m_nTimeOfDeploy) / 2500.0f;
if (m_nSpikeState != STINGERSTATE_STATE1)
- something = 1.0f - something;
+ progress = 1.0f - progress;
- float radangle = something * ARRAY_SIZE(m_vPositions);
- float angle1 = m_fMax_Z + DEGTORAD(radangle);
- float angle2 = m_fMax_Z - DEGTORAD(radangle);
- int pos = clamp(radangle, 0, ARRAY_SIZE(m_vPositions)-1);
+ float degangle = progress * ARRAY_SIZE(m_vPositions);
+ float angle1 = m_fMax_Z + DEGTORAD(degangle);
+ float angle2 = m_fMax_Z - DEGTORAD(degangle);
+ int pos = clamp(degangle, 0, ARRAY_SIZE(m_vPositions)-1);
CVector2D pos2d = m_vPositions[pos];
CVector pos3d = m_vPos;