From 6fcfb9cf36d44ffd662738bde07bc4b5bd5e28de Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 30 Dec 2024 22:21:26 +0100 Subject: [PATCH 1/3] readd this check lel --- src/r_bsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index dbb6fb4d3..66861c49a 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -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; From 3910e66905bd928b62c824a5caa6ca490bbd758e Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 30 Dec 2024 23:10:51 +0100 Subject: [PATCH 2/3] dont try to chase after your spec mobj lel --- src/p_user.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index ce404866e..652fd0fea 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3364,10 +3364,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) From 487018f1467ac64fab0fb6b86ace257820840f47 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 1 Jan 2025 05:37:30 +0100 Subject: [PATCH 3/3] hack: only let freecam for spec move when youre actually able to move as spec cause kart weird, and we cant remove the spec movement due to synch reasons and letting the cam move instantly instead of waiting, may put you in a weird cam position --- src/p_user.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 652fd0fea..e160068ae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -67,6 +67,8 @@ static boolean onground; +static boolean speccam = false; + // // P_Thrust // Moves the given origin along a given angle. @@ -2278,8 +2280,11 @@ static void P_MovePlayer(player_t *player) if (player->spectator) { P_SpectatorMovement(player); + speccam = true; return; } + else + speccam = false; ////////////////////// // MOVEMENT CODE // @@ -3521,7 +3526,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;