Skip to content
Snippets Groups Projects
Commit 085e2d66 authored by Lactozilla's avatar Lactozilla :speech_balloon:
Browse files

Merge branch 'quakefpsfix' into 'next'

Fix quake epicenter calculation for first person and awayviewmobjs

Closes #1296

See merge request STJr/SRB2!2522
parents 68f40d8a 491c77bd
No related branches found
No related tags found
No related merge requests found
...@@ -1152,8 +1152,14 @@ void R_SetupFrame(player_t *player) ...@@ -1152,8 +1152,14 @@ void R_SetupFrame(player_t *player)
if (quake.epicenter) { if (quake.epicenter) {
// Calculate 3D distance from epicenter, using the camera. // Calculate 3D distance from epicenter, using the camera.
fixed_t xydist = R_PointToDist2(thiscam->x, thiscam->y, quake.epicenter->x, quake.epicenter->y); fixed_t xydist, dist;
fixed_t dist = R_PointToDist2(0, thiscam->z, xydist, quake.epicenter->z); if (P_MobjWasRemoved(r_viewmobj)) {
xydist = R_PointToDist2(thiscam->x, thiscam->y, quake.epicenter->x, quake.epicenter->y);
dist = R_PointToDist2(0, thiscam->z, xydist, quake.epicenter->z);
} else {
xydist = R_PointToDist2(r_viewmobj->x, r_viewmobj->y, quake.epicenter->x, quake.epicenter->y);
dist = R_PointToDist2(0, r_viewmobj->z, xydist, quake.epicenter->z);
}
// More effect closer to epicenter, outside of radius = no effect // More effect closer to epicenter, outside of radius = no effect
if (!quake.radius || dist > quake.radius) if (!quake.radius || dist > quake.radius)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment