summaryrefslogtreecommitdiffstats
path: root/src/control/Pickups.cpp
diff options
context:
space:
mode:
authorFire-Head <Fire-Head@users.noreply.github.com>2020-04-20 07:17:08 +0200
committerFire-Head <Fire-Head@users.noreply.github.com>2020-04-20 07:17:08 +0200
commit556a6df4017eb26a4912e62097de3c0033b58a25 (patch)
tree1a356efc35e1e53a67d5474be0bedd848fb52c3e /src/control/Pickups.cpp
parentbeta OddJob(unique jump etc) sliding text (diff)
downloadre3-556a6df4017eb26a4912e62097de3c0033b58a25.tar
re3-556a6df4017eb26a4912e62097de3c0033b58a25.tar.gz
re3-556a6df4017eb26a4912e62097de3c0033b58a25.tar.bz2
re3-556a6df4017eb26a4912e62097de3c0033b58a25.tar.lz
re3-556a6df4017eb26a4912e62097de3c0033b58a25.tar.xz
re3-556a6df4017eb26a4912e62097de3c0033b58a25.tar.zst
re3-556a6df4017eb26a4912e62097de3c0033b58a25.zip
Diffstat (limited to '')
-rw-r--r--src/control/Pickups.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index f9605ca6..a40821f9 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -623,6 +623,34 @@ CPickups::Update()
if (CReplay::IsPlayingBack())
return;
#endif
+#ifdef CAMERA_PICKUP
+ if ( bPickUpcamActivated ) // taken from PS2
+ {
+ float dist = (FindPlayerCoors() - StaticCamCoors).Magnitude2D();
+ float mult;
+ if ( dist < 10.0f )
+ mult = 1.0f - (dist / 10.0f );
+ else
+ mult = 0.0f;
+
+ CVector pos = StaticCamCoors;
+ pos.z += (pPlayerVehicle->GetColModel()->boundingBox.GetSize().z + 2.0f) * mult;
+
+ if ( (CTimer::GetTimeInMilliseconds() - StaticCamStartTime) > 750 )
+ {
+ TheCamera.SetCamPositionForFixedMode(pos, CVector(0.0f, 0.0f, 0.0f));
+ TheCamera.TakeControl(FindPlayerVehicle(), CCam::MODE_FIXED, JUMP_CUT, CAMCONTROL_SCRIPT);
+ }
+
+ if ( FindPlayerVehicle() != pPlayerVehicle
+ || (FindPlayerCoors() - StaticCamCoors).Magnitude() > 40.0f
+ || ((CTimer::GetTimeInMilliseconds() - StaticCamStartTime) > 60000) )
+ {
+ TheCamera.RestoreWithJumpCut();
+ bPickUpcamActivated = false;
+ }
+ }
+#endif
#define PICKUPS_FRAME_SPAN (6)
#ifdef FIX_BUGS
for (uint32 i = NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN) / PICKUPS_FRAME_SPAN; i < NUMGENERALPICKUPS * (CTimer::GetFrameCounter() % PICKUPS_FRAME_SPAN + 1) / PICKUPS_FRAME_SPAN; i++) {