Merge branch 'freecamstuffs' into Saturn-Testing

This commit is contained in:
Alug committed 2025-01-01 17:20:04 +01:00
commit 1558970064
2 files changed
+15 -5

No files matched your search

+14 -4
View File
@@ -63,6 +63,8 @@
static boolean onground;
static boolean speccam = false;
//
// P_Thrust
// Moves the given origin along a given angle.
@@ -2274,8 +2276,11 @@ static void P_MovePlayer(player_t *player)
if (player->spectator)
{
P_SpectatorMovement(player);
speccam = true;
return;
}
else
speccam = false;
//////////////////////
// MOVEMENT CODE //
@@ -3360,10 +3365,15 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
if (cmd->buttons & BT_ATTACK)
{
lastp = &players[displayplayers[0]]; // Fun fact, I was trying displayplayers[0]->mo as if it was Lua like an absolute idiot.
cam->angle = R_PointToAngle2(cam->x, cam->y, lastp->mo->x, lastp->mo->y);
cam->aiming = R_PointToAngle2(0, cam->z, R_PointToDist2(cam->x, cam->y, lastp->mo->x, lastp->mo->y), lastp->mo->z + lastp->mo->scale*128*P_MobjFlip(lastp->mo)); // This is still unholy. Aim a bit above their heads.
cam->reset_aiming = false;
// dont chase after your spectator self
if (!lastp->spectator)
{
const fixed_t dist = R_PointToDist2(cam->x, cam->y, lastp->mo->x, lastp->mo->y);
cam->angle = R_PointToAngle2(cam->x, cam->y, lastp->mo->x, lastp->mo->y);
cam->aiming = R_PointToAngle2(0, cam->z, dist, lastp->mo->z + lastp->mo->scale*128*P_MobjFlip(lastp->mo)); // This is still unholy. Aim a bit above their heads.
cam->reset_aiming = false;
}
}
if (cmd->forwardmove != 0)
@@ -3512,7 +3522,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
num = 0;
}
if (thiscam->freecam || player->spectator)
if (thiscam->freecam || (player->spectator && speccam == true))
{
P_DemoCameraMovement(thiscam, num);
return true;
+1 -1
View File
@@ -265,7 +265,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
boolean underwater;
UINT8 i = R_GetViewNumber();
if (camera[i].chase)
if (viewplayer == &players[displayplayers[i]] && camera[i].chase)
heightsec = R_PointInSubsector(camera[i].x, camera[i].y)->sector->heightsec;
else if (i > splitscreen && viewmobj)
heightsec = R_PointInSubsector(pviewmobj->x, pviewmobj->y)->sector->heightsec;