clean shit up even more + fix cam aiming reset
dont really care about which input anyways.
This commit is contained in:
1 parent
e9b1329f15
commit
dc6904fad2
2 files changed
+12
-14
No files matched your search
+6
-11
@@ -844,20 +844,14 @@ static fixed_t angleturn[3] = {KART_FULLTURN/2, KART_FULLTURN, KART_FULLTURN/4};
|
||||
// but we need this if we dont want spectators to move but be able to go to freecam from watching someone
|
||||
static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer)
|
||||
{
|
||||
boolean forward = false;
|
||||
boolean moveinput = false;
|
||||
INT32 axis = 0;
|
||||
const UINT8 forplayer = (ssplayer-1);
|
||||
const boolean usejoystick = (cv_usejoystick[forplayer].value);
|
||||
|
||||
boolean turn = (InputDown(gc_turnleft, ssplayer) || InputDown(gc_turnright, ssplayer));
|
||||
axis = JoyAxis(AXISTURN, ssplayer);
|
||||
boolean side = (turn || (usejoystick && axis != 0));
|
||||
|
||||
axis = JoyAxis(AXISAIM, ssplayer);
|
||||
if (InputDown(gc_aimforward, ssplayer) || (usejoystick && axis < 0))
|
||||
forward = true;
|
||||
if (InputDown(gc_aimbackward, ssplayer) || (usejoystick && axis > 0))
|
||||
forward = true;
|
||||
moveinput = (InputDown(gc_turnleft, ssplayer) || InputDown(gc_turnright, ssplayer)
|
||||
|| InputDown(gc_aimforward, ssplayer) || InputDown(gc_aimbackward, ssplayer) ||
|
||||
(usejoystick && JoyAxis(AXISAIM, ssplayer) != 0) || (usejoystick && JoyAxis(AXISTURN, ssplayer) != 0));
|
||||
|
||||
// check for inputs and return button commands
|
||||
// for stuff like joining with item button, etc.
|
||||
@@ -876,11 +870,12 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer)
|
||||
#undef CHECKINPUT
|
||||
|
||||
// Reset to our spec player if we watch someone else.
|
||||
if ((forward || side || cmd->buttons)
|
||||
if ((moveinput || cmd->buttons)
|
||||
&& displayplayers[0] != consoleplayer && ssplayer == 1)
|
||||
{
|
||||
displayplayers[0] = consoleplayer;
|
||||
R_ResetViewInterpolation(0);
|
||||
camera[0].reset_aiming = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-3
@@ -3141,7 +3141,9 @@ void P_ToggleDemoCamera(UINT8 viewnum)
|
||||
|
||||
// dont let freecam be toggled when in spec lel
|
||||
if (players[displayplayers[viewnum]].spectator)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!cam->freecam) // toggle on
|
||||
{
|
||||
@@ -3322,13 +3324,14 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
|
||||
|
||||
// let centerview work proper
|
||||
if (InputDown(gc_centerview, forplayer))
|
||||
{
|
||||
cam->aiming = 0;
|
||||
cam->reset_aiming = false;
|
||||
}
|
||||
|
||||
if (cmd->aiming != 0)
|
||||
{
|
||||
cam->aiming = cmd->aiming << FRACBITS;
|
||||
|
||||
cam->reset_aiming = false;
|
||||
}
|
||||
|
||||
cam->angle = (angle_t)cmd->angleturn << 16;
|
||||
@@ -3360,7 +3363,7 @@ static void P_DemoCameraMovement(camera_t *cam, UINT8 num)
|
||||
|
||||
// if you hold item, you will lock on to displayplayer. (The last player you were ""f12-ing"")
|
||||
// well this only really works in replays for us, since we still move our spec player around which causes displayplayer to be the spec player
|
||||
if (cmd->buttons & BT_ATTACK)
|
||||
if (cam->freecam && 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.
|
||||
|
||||
|
||||
Reference in new issue
Block a user