mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 15:32:33 +00:00
Merge branch 'demo-replay-fixes' into 'next'
Demo replay fixes Changes made/bugs fixed in this branch: * Replay camera is now controllable when climbing (https://mb.srb2.org/showthread.php?t=38668), and in waterslides * localangle (read: the angle between you and the camera, I think) now doesn't change during demo replays in most situations, unless the player is in analog mode. Exceptions include zoomtubes and NiGHTS super * Replay camera now doesn't act silly if the player is in analog mode (assuming you also recorded it in that mode to begin with, anyway) See merge request !66
This commit is contained in:
commit
987f65fde8
5 changed files with 85 additions and 56 deletions
|
@ -1009,10 +1009,10 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
}
|
||||
if (cv_analog.value || twodlevel
|
||||
|| (player->mo && (player->mo->flags2 & MF2_TWOD))
|
||||
|| player->climbing
|
||||
|| (!demoplayback && (player->climbing
|
||||
|| (player->pflags & PF_NIGHTSMODE)
|
||||
|| (player->pflags & PF_SLIDING)
|
||||
|| (player->pflags & PF_FORCESTRAFE)) // Analog
|
||||
|| (player->pflags & PF_FORCESTRAFE)))) // Analog
|
||||
forcestrafe = true;
|
||||
if (forcestrafe) // Analog
|
||||
{
|
||||
|
@ -1184,8 +1184,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics)
|
|||
if (!mouseaiming && cv_mousemove.value)
|
||||
forward += mousey;
|
||||
|
||||
if (cv_analog.value || player->climbing
|
||||
|| (player->pflags & PF_SLIDING)) // Analog for mouse
|
||||
if (cv_analog.value ||
|
||||
(!demoplayback && (player->climbing
|
||||
|| (player->pflags & PF_SLIDING)))) // Analog for mouse
|
||||
side += mousex*2;
|
||||
else
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - (mousex*8));
|
||||
|
|
|
@ -169,6 +169,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
|||
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
||||
boolean P_SuperReady(player_t *player);
|
||||
void P_DoJump(player_t *player, boolean soundandstate);
|
||||
boolean P_AnalogMove(player_t *player);
|
||||
boolean P_TransferToNextMare(player_t *player);
|
||||
UINT8 P_FindLowestMare(void);
|
||||
void P_FindEmerald(void);
|
||||
|
|
33
src/p_map.c
33
src/p_map.c
|
@ -189,10 +189,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
{
|
||||
object->angle = spring->angle;
|
||||
|
||||
if (object->player == &players[consoleplayer])
|
||||
localangle = spring->angle;
|
||||
else if (object->player == &players[secondarydisplayplayer])
|
||||
localangle2 = spring->angle;
|
||||
if (!demoplayback || P_AnalogMove(object->player))
|
||||
{
|
||||
if (object->player == &players[consoleplayer])
|
||||
localangle = spring->angle;
|
||||
else if (object->player == &players[secondarydisplayplayer])
|
||||
localangle2 = spring->angle;
|
||||
}
|
||||
}
|
||||
|
||||
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
|
||||
|
@ -662,10 +665,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
thing->angle = tmthing->angle;
|
||||
|
||||
if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
localangle2 = thing->angle;
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
{
|
||||
if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
localangle2 = thing->angle;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2656,10 +2662,13 @@ isblocking:
|
|||
&& P_IsClimbingValid(slidemo->player, climbangle))
|
||||
{
|
||||
slidemo->angle = climbangle;
|
||||
if (slidemo->player == &players[consoleplayer])
|
||||
localangle = slidemo->angle;
|
||||
else if (slidemo->player == &players[secondarydisplayplayer])
|
||||
localangle2 = slidemo->angle;
|
||||
if (!demoplayback || P_AnalogMove(slidemo->player))
|
||||
{
|
||||
if (slidemo->player == &players[consoleplayer])
|
||||
localangle = slidemo->angle;
|
||||
else if (slidemo->player == &players[secondarydisplayplayer])
|
||||
localangle2 = slidemo->angle;
|
||||
}
|
||||
|
||||
if (!slidemo->player->climbing)
|
||||
{
|
||||
|
|
46
src/p_spec.c
46
src/p_spec.c
|
@ -3669,10 +3669,13 @@ DoneSection2:
|
|||
|
||||
player->mo->angle = lineangle;
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
}
|
||||
|
||||
if (!(lines[i].flags & ML_EFFECT4))
|
||||
{
|
||||
|
@ -7499,24 +7502,27 @@ void T_Pusher(pusher_t *p)
|
|||
P_SetPlayerMobjState (thing, thing->info->painstate); // Whee!
|
||||
thing->angle = R_PointToAngle2 (0, 0, xspeed<<(FRACBITS-PUSH_FACTOR), yspeed<<(FRACBITS-PUSH_FACTOR));
|
||||
|
||||
if (thing->player == &players[consoleplayer])
|
||||
if (!demoplayback || P_AnalogMove(thing->player))
|
||||
{
|
||||
if (thing->angle - localangle > ANGLE_180)
|
||||
localangle -= (localangle - thing->angle) / 8;
|
||||
else
|
||||
localangle += (thing->angle - localangle) / 8;
|
||||
if (thing->player == &players[consoleplayer])
|
||||
{
|
||||
if (thing->angle - localangle > ANGLE_180)
|
||||
localangle -= (localangle - thing->angle) / 8;
|
||||
else
|
||||
localangle += (thing->angle - localangle) / 8;
|
||||
}
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
{
|
||||
if (thing->angle - localangle2 > ANGLE_180)
|
||||
localangle2 -= (localangle2 - thing->angle) / 8;
|
||||
else
|
||||
localangle2 += (thing->angle - localangle2) / 8;
|
||||
}
|
||||
/*if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
localangle2 = thing->angle;*/
|
||||
}
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
{
|
||||
if (thing->angle - localangle2 > ANGLE_180)
|
||||
localangle2 -= (localangle2 - thing->angle) / 8;
|
||||
else
|
||||
localangle2 += (thing->angle - localangle2) / 8;
|
||||
}
|
||||
/*if (thing->player == &players[consoleplayer])
|
||||
localangle = thing->angle;
|
||||
else if (thing->player == &players[secondarydisplayplayer])
|
||||
localangle2 = thing->angle;*/
|
||||
}
|
||||
|
||||
if (p->exclusive)
|
||||
|
|
52
src/p_user.c
52
src/p_user.c
|
@ -2705,10 +2705,13 @@ static void P_DoClimbing(player_t *player)
|
|||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale));
|
||||
}
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
}
|
||||
|
||||
if (player->climbing == 0)
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_ATK1);
|
||||
|
@ -3566,10 +3569,13 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
|||
|
||||
player->mo->angle = player->mo->angle - ANGLE_180; // Turn around from the wall you were climbing.
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
}
|
||||
|
||||
player->climbing = 0; // Stop climbing, duh!
|
||||
P_InstaThrust(player->mo, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale)); // Jump off the wall.
|
||||
|
@ -4219,7 +4225,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
static boolean P_AnalogMove(player_t *player)
|
||||
boolean P_AnalogMove(player_t *player)
|
||||
{
|
||||
return player->pflags & PF_ANALOGMODE;
|
||||
}
|
||||
|
@ -7550,7 +7556,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target
|
|||
|
||||
// change angle
|
||||
source->angle = R_PointToAngle2(source->x, source->y, enemy->x, enemy->y);
|
||||
if (source->player)
|
||||
if (source->player && (!demoplayback || P_AnalogMove(source->player)))
|
||||
{
|
||||
if (source->player == &players[consoleplayer])
|
||||
localangle = source->angle;
|
||||
|
@ -7969,6 +7975,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y);
|
||||
}
|
||||
}
|
||||
else if (P_AnalogMove(player)) // Analog
|
||||
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
|
||||
else if (demoplayback)
|
||||
{
|
||||
angle = focusangle;
|
||||
|
@ -7981,8 +7989,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
localangle -= abs((signed)(focusangle - localangle))>>5;
|
||||
}
|
||||
}
|
||||
else if (P_AnalogMove(player)) // Analog
|
||||
angle = R_PointToAngle2(thiscam->x, thiscam->y, mo->x, mo->y);
|
||||
else
|
||||
angle = focusangle + FixedAngle(camrotate*FRACUNIT);
|
||||
|
||||
|
@ -9354,10 +9360,13 @@ void P_PlayerAfterThink(player_t *player)
|
|||
{
|
||||
player->mo->angle = player->mo->tracer->angle;
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle;
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
}
|
||||
}
|
||||
|
||||
if (P_AproxDistance(player->mo->x - player->mo->tracer->x, player->mo->y - player->mo->tracer->y) > player->mo->radius)
|
||||
|
@ -9424,10 +9433,13 @@ void P_PlayerAfterThink(player_t *player)
|
|||
player->mo->tracer->target->health += cmd->sidemove;
|
||||
player->mo->angle += cmd->sidemove<<ANGLETOFINESHIFT; // 2048 --> ANGLE_MAX
|
||||
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
if (!demoplayback || P_AnalogMove(player))
|
||||
{
|
||||
if (player == &players[consoleplayer])
|
||||
localangle = player->mo->angle; // Adjust the local control angle.
|
||||
else if (player == &players[secondarydisplayplayer])
|
||||
localangle2 = player->mo->angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue