Fix camera not noclipping FOFs
This commit is contained in:
parent
89887ccf0d
commit
ebb0733a3c
13
src/p_user.c
13
src/p_user.c
|
@ -8162,10 +8162,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
|
fixed_t x, y, z, dist, height, viewpointx, viewpointy, camspeed, camdist, camheight, pviewheight;
|
||||||
fixed_t pan, xpan, ypan;
|
fixed_t pan, xpan, ypan;
|
||||||
INT32 camrotate;
|
INT32 camrotate;
|
||||||
boolean camstill, cameranoclip, lookback;
|
boolean camstill, lookback;
|
||||||
mobj_t *mo;
|
mobj_t *mo;
|
||||||
subsector_t *newsubsec;
|
|
||||||
fixed_t f1, f2;
|
fixed_t f1, f2;
|
||||||
|
#ifndef NOCLIPCAM
|
||||||
|
boolean cameranoclip;
|
||||||
|
subsector_t *newsubsec;
|
||||||
|
#endif
|
||||||
|
|
||||||
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
// We probably shouldn't move the camera if there is no player or player mobj somehow
|
||||||
if (!player || !player->mo)
|
if (!player || !player->mo)
|
||||||
|
@ -8173,9 +8176,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
|
|
||||||
mo = player->mo;
|
mo = player->mo;
|
||||||
|
|
||||||
#ifdef NOCLIPCAM
|
#ifndef NOCLIPCAM
|
||||||
cameranoclip = true; // We like camera noclip!
|
|
||||||
#else
|
|
||||||
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
|
||||||
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|
||||||
|| (leveltime < introtime)); // Kart intro cam
|
|| (leveltime < introtime)); // Kart intro cam
|
||||||
|
@ -8411,6 +8412,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
else
|
else
|
||||||
z = mo->z + pviewheight + camheight;
|
z = mo->z + pviewheight + camheight;
|
||||||
|
|
||||||
|
#ifndef NOCLIPCAM // Disable all z-clipping for noclip cam
|
||||||
// move camera down to move under lower ceilings
|
// move camera down to move under lower ceilings
|
||||||
newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
||||||
|
|
||||||
|
@ -8608,6 +8610,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
|
|
||||||
if (thiscam->z < thiscam->floorz && !cameranoclip)
|
if (thiscam->z < thiscam->floorz && !cameranoclip)
|
||||||
thiscam->z = thiscam->floorz;
|
thiscam->z = thiscam->floorz;
|
||||||
|
#endif // NOCLIPCAM
|
||||||
|
|
||||||
// point viewed by the camera
|
// point viewed by the camera
|
||||||
// this point is just 64 unit forward the player
|
// this point is just 64 unit forward the player
|
||||||
|
|
Loading…
Reference in New Issue