mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 12:01:05 +00:00
fix quake epicenter for first person and awayviews
This commit is contained in:
parent
fafa522c50
commit
209c545743
1 changed files with 8 additions and 2 deletions
10
src/r_main.c
10
src/r_main.c
|
@ -1152,8 +1152,14 @@ void R_SetupFrame(player_t *player)
|
|||
|
||||
if (quake.epicenter) {
|
||||
// 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 dist = R_PointToDist2(0, thiscam->z, xydist, quake.epicenter->z);
|
||||
fixed_t xydist, dist;
|
||||
if (r_viewmobj == NULL) {
|
||||
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
|
||||
if (!quake.radius || dist > quake.radius)
|
||||
|
|
Loading…
Reference in a new issue