mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-22 19:02:45 +00:00
Merge branch 'horizontal_fix' into 'master'
Fixes to horizontal spring collision Fixed various issues arising from collision with exclusively horizontal springs. Thamks to @Inuyasha for the heads up! Of note: * If you hold down your jump button whilst jumping into it, you no longer immediately use your ability. * Characters with (CA_DOUBLEJUMP && CA2_MULTIABILITY) or CA_FLOAT or CA_HOVER no longer lose track of their jump count. Also: * Upped the strength of info.c's red and yellow horizontal springs. See merge request !41
This commit is contained in:
commit
303648bf3b
3 changed files with 17 additions and 11 deletions
|
@ -5610,7 +5610,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
32*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
16*FRACUNIT, // damage
|
||||
36*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags
|
||||
S_YHORIZ2 // raisestate
|
||||
|
@ -5637,7 +5637,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
32*FRACUNIT, // height
|
||||
0, // display offset
|
||||
0, // mass
|
||||
64*FRACUNIT, // damage
|
||||
72*FRACUNIT, // damage
|
||||
sfx_None, // activesound
|
||||
MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags
|
||||
S_RHORIZ2 // raisestate
|
||||
|
|
22
src/p_map.c
22
src/p_map.c
|
@ -115,6 +115,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
fixed_t offx, offy;
|
||||
fixed_t vertispeed = spring->info->mass;
|
||||
fixed_t horizspeed = spring->info->damage;
|
||||
UINT8 jumping, secondjump;
|
||||
|
||||
if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic
|
||||
return false;
|
||||
|
@ -203,25 +204,30 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
|
|||
}
|
||||
|
||||
pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these.
|
||||
jumping = object->player->jumping;
|
||||
secondjump = object->player->secondjump;
|
||||
P_ResetPlayer(object->player);
|
||||
|
||||
if (P_MobjFlip(object)*vertispeed > 0)
|
||||
if (spring->info->painchance)
|
||||
{
|
||||
object->player->pflags |= PF_JUMPED;
|
||||
P_SetPlayerMobjState(object, S_PLAY_JUMP);
|
||||
}
|
||||
else if (P_MobjFlip(object)*vertispeed > 0)
|
||||
P_SetPlayerMobjState(object, S_PLAY_SPRING);
|
||||
else if (P_MobjFlip(object)*vertispeed < 0)
|
||||
P_SetPlayerMobjState(object, S_PLAY_FALL);
|
||||
else // horizontal spring
|
||||
{
|
||||
if (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL))
|
||||
object->player->pflags = pflags;
|
||||
{
|
||||
object->player->pflags |= pflags;
|
||||
object->player->jumping = jumping;
|
||||
object->player->secondjump = secondjump;
|
||||
}
|
||||
else
|
||||
P_SetPlayerMobjState(object, S_PLAY_WALK);
|
||||
}
|
||||
|
||||
if (spring->info->painchance)
|
||||
{
|
||||
object->player->pflags |= PF_JUMPED;
|
||||
P_SetPlayerMobjState(object, S_PLAY_JUMP);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1885,7 +1885,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
|
|||
mo->momx = player->cmomx;
|
||||
mo->momy = player->cmomy;
|
||||
}
|
||||
else
|
||||
else if (!(mo->eflags & MFE_SPRUNG))
|
||||
{
|
||||
if (oldx == mo->x && oldy == mo->y) // didn't go anywhere
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue