From e7c0fd26ba95b81c0b55bc789e507f8b0c1c32f8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 16 Apr 2016 21:28:08 +0200 Subject: [PATCH 1/2] - restored an accidentally deleted line in the Heresiarch code. --- src/g_hexen/a_heresiarch.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index d6ce35d18..6cade1002 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -824,6 +824,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Orbit) else // Clock wise { self->specialf1 -= 10; + angle = self->specialf1; pos = parent->Vec3Angle(dist, angle, parent->Floorclip + SORC_DEFENSE_HEIGHT); pos.Z += 20 * angle.Sin(); // Spawn trailer From 7ac0cfbbb9f0419ef7de0f8e6041519b10ba48a0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 16 Apr 2016 22:54:47 +0200 Subject: [PATCH 2/2] - added support for angle changing portals to P_AimCamera. --- src/p_local.h | 2 +- src/p_map.cpp | 3 ++- src/r_utility.cpp | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 45b02e8ea..a5336a9ee 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -335,7 +335,7 @@ bool P_CheckMissileSpawn(AActor *missile, double maxdist); void P_PlaySpawnSound(AActor *missile, AActor *spawner); // [RH] Position the chasecam -void P_AimCamera (AActor *t1, DVector3 &, sector_t *&sec, bool &unlinked); +void P_AimCamera (AActor *t1, DVector3 &, DAngle &, sector_t *&sec, bool &unlinked); // [RH] Means of death enum diff --git a/src/p_map.cpp b/src/p_map.cpp index c28d3044f..8254ac5bb 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4714,7 +4714,7 @@ void P_RailAttack(FRailParams *p) CVAR(Float, chase_height, -8.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Float, chase_dist, 90.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -void P_AimCamera(AActor *t1, DVector3 &campos, sector_t *&CameraSector, bool &unlinked) +void P_AimCamera(AActor *t1, DVector3 &campos, DAngle &camangle, sector_t *&CameraSector, bool &unlinked) { double distance = clamp(chase_dist, 0, 30000); DAngle angle = t1->Angles.Yaw - 180; @@ -4740,6 +4740,7 @@ void P_AimCamera(AActor *t1, DVector3 &campos, sector_t *&CameraSector, bool &un } CameraSector = trace.Sector; unlinked = trace.unlinked; + camangle = trace.SrcAngleFromTarget - 180.; } diff --git a/src/r_utility.cpp b/src/r_utility.cpp index f2908c6fa..0977505fd 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -937,8 +937,10 @@ void R_SetupFrame (AActor *actor) sector_t *oldsector = R_PointInSubsector(iview->Old.Pos)->sector; // [RH] Use chasecam view DVector3 campos; - P_AimCamera (camera, campos, viewsector, unlinked); // fixme: This needs to translate the angle, too. + DAngle camangle; + P_AimCamera (camera, campos, camangle, viewsector, unlinked); // fixme: This needs to translate the angle, too. iview->New.Pos = campos; + iview->New.Angles.Yaw = camangle; r_showviewer = true; // Interpolating this is a very complicated thing because nothing keeps track of the aim camera's movement, so whenever we detect a portal transition // it's probably best to just reset the interpolation for this move.