From 1d682e8a960bdf7d683821697903b8252071e750 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 3 Jul 2023 21:51:47 +0100 Subject: [PATCH] Couple of Blood fixes - Projectile and crosshair origin now correct - Don't shift view up/down in relation to pitch - Version number update --- source/core/version.h | 2 +- source/games/blood/src/player.cpp | 5 +++-- source/games/blood/src/view.cpp | 4 +++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/core/version.h b/source/core/version.h index 090f13e98..62948a345 100644 --- a/source/core/version.h +++ b/source/core/version.h @@ -44,7 +44,7 @@ const char *GetVersionString(); #define VERSIONSTR "1.7pre" -#define RAZEXR_VERSIONSTR "RazeXR 0.2.5" +#define RAZEXR_VERSIONSTR "RazeXR 0.2.6" // The version as seen in the Windows resource #define RC_FILEVERSION 1,6,9999,0 diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 4ead9a4f5..7ce036de0 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -1541,7 +1541,7 @@ void ProcessInput(PLAYER* pPlayer) get_weapon_pos_and_angle(px, py, pz, pitch, yaw); //Position for crosshair calculation - DVector3 spos = actor->spr.pos.plusZ(-((pz * vr_hunits_per_meter()) + actor->viewzoffset)); + DVector3 spos = actor->spr.pos.plusZ(-((pz * vr_hunits_per_meter()) + actor->viewzoffset - pPosture->weaponAboveZ)); posXY = DVector2(px * vr_hunits_per_meter(), py * vr_hunits_per_meter()).Rotated(-DAngle90 + actor->spr.Angles.Yaw); spos.X -= posXY.X; spos.Y -= posXY.Y; @@ -1549,7 +1549,8 @@ void ProcessInput(PLAYER* pPlayer) //Update player angles and position for shooting actor->spr.pos.X -= posXY.X; actor->spr.pos.Y -= posXY.Y; - pPlayer->zWeapon = actor->spr.pos.Z - ((pz * vr_hunits_per_meter()) + actor->viewzoffset); + + pPlayer->zWeapon = actor->spr.pos.Z - ((pz * vr_hunits_per_meter()) + actor->viewzoffset - pPosture->weaponAboveZ); actor->spr.Angles.Yaw += DAngle::fromDeg(yaw); actor->spr.Angles.Pitch -= DAngle::fromDeg(pitch); pPlayer->slope = actor->spr.Angles.Pitch.Tan(); diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 456f5c022..d96933a9e 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -489,7 +489,9 @@ static void SetupView(PLAYER* pPlayer, DVector3& cPos, DRotator& cAngles, sector { cPos.Z += bobHeight; } - cPos.Z -= 10. * (cAngles.Pitch / DAngle90); + + //Don't do this in VR, feels weird +// cPos.Z -= 10. * (cAngles.Pitch / DAngle90); } else {