mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 04:21:23 +00:00
Merge branch 'issue1133' into 'next'
Rollout rock handling with gravity boots See merge request STJr/SRB2!2343
This commit is contained in:
commit
30f1ac31e4
4 changed files with 24 additions and 3 deletions
|
@ -14857,12 +14857,18 @@ void A_RolloutRock(mobj_t *actor)
|
||||||
|
|
||||||
if (!actor->tracer || P_MobjWasRemoved(actor->tracer) || !actor->tracer->health)
|
if (!actor->tracer || P_MobjWasRemoved(actor->tracer) || !actor->tracer->health)
|
||||||
actor->flags |= MF_PUSHABLE;
|
actor->flags |= MF_PUSHABLE;
|
||||||
|
else if (actor->tracer->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
actor->flags2 |= MF2_OBJECTFLIP;
|
||||||
|
actor->eflags |= MFE_VERTICALFLIP;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actor->flags2 = (actor->flags2 & ~MF2_OBJECTFLIP) | (actor->tracer->flags2 & MF2_OBJECTFLIP);
|
actor->flags2 &= ~MF2_OBJECTFLIP;
|
||||||
actor->eflags = (actor->eflags & ~MFE_VERTICALFLIP) | (actor->tracer->eflags & MFE_VERTICALFLIP);
|
actor->eflags &= ~MFE_VERTICALFLIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves
|
actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves
|
||||||
|
|
||||||
if (actor->eflags & MFE_JUSTHITFLOOR)
|
if (actor->eflags & MFE_JUSTHITFLOOR)
|
||||||
|
|
|
@ -1027,7 +1027,6 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
|
||||||
if ((thing->flags & MF_PUSHABLE) // not carrying a player
|
if ((thing->flags & MF_PUSHABLE) // not carrying a player
|
||||||
&& (tmthing->player->powers[pw_carry] == CR_NONE) // player is not already riding something
|
&& (tmthing->player->powers[pw_carry] == CR_NONE) // player is not already riding something
|
||||||
&& !(tmthing->player->powers[pw_ignorelatch] & (1<<15))
|
&& !(tmthing->player->powers[pw_ignorelatch] & (1<<15))
|
||||||
&& ((tmthing->eflags & MFE_VERTICALFLIP) == (thing->eflags & MFE_VERTICALFLIP))
|
|
||||||
&& (P_MobjFlip(tmthing)*tmthing->momz <= 0)
|
&& (P_MobjFlip(tmthing)*tmthing->momz <= 0)
|
||||||
&& ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2))
|
&& ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2))
|
||||||
|| (tmthing->eflags & MFE_VERTICALFLIP && abs(tmthing->z + tmthing->height - thing->z) < (thing->height>>2))))
|
|| (tmthing->eflags & MFE_VERTICALFLIP && abs(tmthing->z + tmthing->height - thing->z) < (thing->height>>2))))
|
||||||
|
@ -1041,6 +1040,7 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
|
||||||
P_SetTarget(&tmthing->tracer, thing);
|
P_SetTarget(&tmthing->tracer, thing);
|
||||||
if (!P_IsObjectOnGround(thing))
|
if (!P_IsObjectOnGround(thing))
|
||||||
thing->momz += tmthing->momz;
|
thing->momz += tmthing->momz;
|
||||||
|
|
||||||
return CHECKTHING_COLLIDE;
|
return CHECKTHING_COLLIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1385,6 +1385,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
case MT_WATERDROP:
|
case MT_WATERDROP:
|
||||||
case MT_CYBRAKDEMON:
|
case MT_CYBRAKDEMON:
|
||||||
gravityadd >>= 1;
|
gravityadd >>= 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
14
src/p_user.c
14
src/p_user.c
|
@ -1089,6 +1089,13 @@ void P_ResetPlayer(player_t *player)
|
||||||
if (player->mo->tracer && !P_MobjWasRemoved(player->mo->tracer))
|
if (player->mo->tracer && !P_MobjWasRemoved(player->mo->tracer))
|
||||||
{
|
{
|
||||||
player->mo->tracer->flags |= MF_PUSHABLE;
|
player->mo->tracer->flags |= MF_PUSHABLE;
|
||||||
|
|
||||||
|
// goose the mom a little bit to trigger gravity to process for a tic
|
||||||
|
if (player->mo->tracer->eflags & MFE_VERTICALFLIP)
|
||||||
|
player->mo->tracer->momz -= 1;
|
||||||
|
else
|
||||||
|
player->mo->tracer->momz += 1;
|
||||||
|
|
||||||
P_SetTarget(&player->mo->tracer->tracer, NULL);
|
P_SetTarget(&player->mo->tracer->tracer, NULL);
|
||||||
}
|
}
|
||||||
P_SetTarget(&player->mo->tracer, NULL);
|
P_SetTarget(&player->mo->tracer, NULL);
|
||||||
|
@ -4546,6 +4553,13 @@ void P_DoJump(player_t *player, boolean soundandstate, boolean allowflip)
|
||||||
player->mo->momz += player->mo->tracer->momz;
|
player->mo->momz += player->mo->tracer->momz;
|
||||||
if (!P_IsObjectOnGround(player->mo->tracer))
|
if (!P_IsObjectOnGround(player->mo->tracer))
|
||||||
P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true);
|
P_SetObjectMomZ(player->mo->tracer, -9*FRACUNIT, true);
|
||||||
|
|
||||||
|
// goose the mom a little bit to trigger gravity to process for a tic
|
||||||
|
if (player->mo->tracer->eflags & MFE_VERTICALFLIP)
|
||||||
|
player->mo->tracer->momz -= 1;
|
||||||
|
else
|
||||||
|
player->mo->tracer->momz += 1;
|
||||||
|
|
||||||
player->mo->tracer->flags |= MF_PUSHABLE;
|
player->mo->tracer->flags |= MF_PUSHABLE;
|
||||||
P_SetTarget(&player->mo->tracer->tracer, NULL);
|
P_SetTarget(&player->mo->tracer->tracer, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue