P_DemoCameraMovement: cancel out up/down movement

This commit is contained in:
James R 2023-10-09 18:47:20 -07:00
parent fa89576f34
commit 29feceda88

View file

@ -2913,15 +2913,19 @@ void P_DemoCameraMovement(camera_t *cam, UINT8 num)
// camera movement:
if (!cam->button_a_held)
{
if (cmd->buttons & BT_ACCELERATE)
int dir = ((cmd->buttons & BT_ACCELERATE) ? 1 : 0) + ((cmd->buttons & BT_BRAKE) ? -1 : 0);
switch (dir)
{
case 1:
cam->z += 32*mapobjectscale;
moving = true;
}
else if (cmd->buttons & BT_BRAKE)
{
break;
case -1:
cam->z -= 32*mapobjectscale;
moving = true;
break;
}
}