Two one liners related to angles, so doin' em in a single branch.

* If a spring has vertical speed AND horizontal speed, always set the player's angle when touching it.
* If you have less than 32 rings and spill them, they now get launched away from the player's motion, rather than in the direction of the camera.
This commit is contained in:
toaster 2019-07-29 20:29:02 +01:00
parent 18e2c2461f
commit 62c708e64a
2 changed files with 8 additions and 3 deletions

View File

@ -3652,7 +3652,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
{
INT32 i;
mobj_t *mo;
angle_t fa;
angle_t fa, va;
fixed_t ns;
fixed_t z;
boolean nightsreplace = ((maptol & TOL_NIGHTS) && !G_IsSpecialStage(gamemap));
@ -3674,6 +3674,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
// Spill weapons first
P_PlayerWeaponPanelOrAmmoBurst(player);
if (abs(player->mo->momx) > player->mo->scale || abs(player->mo->momy) > player->mo->scale)
va = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0)>>ANGLETOFINESHIFT;
else
va = player->mo->angle>>ANGLETOFINESHIFT;
for (i = 0; i < num_rings; i++)
{
INT32 objType = mobjinfo[MT_RING].reactiontime;
@ -3695,7 +3700,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
P_SetScale(mo, player->mo->scale);
// Angle offset by player angle, then slightly offset by amount of rings
fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT) - ((num_rings-1)*FINEANGLES/32)) & FINEMASK;
fa = ((i*FINEANGLES/16) + va - ((num_rings-1)*FINEANGLES/32)) & FINEMASK;
// Make rings spill out around the player in 16 directions like SA, but spill like Sonic 2.
// Technically a non-SA way of spilling rings. They just so happen to be a little similar.

View File

@ -342,7 +342,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (horizspeed)
{
object->player->drawangle = spring->angle;
if (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)
if (vertispeed || (object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0))
{
object->angle = spring->angle;