mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-03-23 19:32:40 +00:00
Fix shells spawning under FOFs
Make items dropped behind you fall on the floor properly Fix bananas getting stuck in midair if they aren't moving
This commit is contained in:
parent
8f532b48ef
commit
8fbdbb4c64
2 changed files with 48 additions and 19 deletions
52
src/k_kart.c
52
src/k_kart.c
|
@ -1842,18 +1842,6 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
|
||||
th->flags2 |= flags2;
|
||||
|
||||
if (P_IsObjectOnGround(source))
|
||||
{
|
||||
// spawn on the ground if the player is on the ground
|
||||
if (P_MobjFlip(source) < 0)
|
||||
{
|
||||
th->z = th->ceilingz - th->height;
|
||||
th->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
else
|
||||
th->z = th->floorz;
|
||||
}
|
||||
|
||||
th->threshold = 10;
|
||||
|
||||
#ifdef WEAPON_SFX
|
||||
|
@ -1868,6 +1856,21 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
|
|||
|
||||
P_SetTarget(&th->target, source);
|
||||
|
||||
if (P_IsObjectOnGround(source))
|
||||
{
|
||||
// floorz and ceilingz aren't properly set to account for FOFs and Polyobjects on spawn
|
||||
// This should set it for FOFs
|
||||
P_TeleportMove(th, th->x, th->y, th->z);
|
||||
// spawn on the ground if the player is on the ground
|
||||
if (P_MobjFlip(source) < 0)
|
||||
{
|
||||
th->z = th->ceilingz - th->height;
|
||||
th->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
else
|
||||
th->z = th->floorz;
|
||||
}
|
||||
|
||||
th->angle = an;
|
||||
th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT));
|
||||
th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT));
|
||||
|
@ -2072,9 +2075,34 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
|
|||
|
||||
mo = P_SpawnMobj(newx, newy, player->mo->z, mapthing);
|
||||
|
||||
if (P_MobjFlip(player->mo) < 0)
|
||||
mo->z = player->mo->z + player->mo->height - mo->height;
|
||||
|
||||
mo->threshold = 10;
|
||||
P_SetTarget(&mo->target, player->mo);
|
||||
|
||||
if (P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
// floorz and ceilingz aren't properly set to account for FOFs and Polyobjects on spawn
|
||||
// This should set it for FOFs
|
||||
P_TeleportMove(mo, mo->x, mo->y, mo->z);
|
||||
|
||||
if (P_MobjFlip(mo) > 0)
|
||||
{
|
||||
if (mo->floorz > mo->target->z - mo->height)
|
||||
{
|
||||
mo->z = mo->floorz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mo->ceilingz < mo->target->z + mo->target->height + mo->height)
|
||||
{
|
||||
mo->z = mo->ceilingz - mo->height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mo)
|
||||
{
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
|
|
15
src/p_mobj.c
15
src/p_mobj.c
|
@ -2303,6 +2303,14 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
case MT_BIGTUMBLEWEED:
|
||||
case MT_LITTLETUMBLEWEED:
|
||||
case MT_SHELL:
|
||||
// SRB2kart stuff that should die in pits
|
||||
// Shouldn't stop moving along the Z if there's no speed though!
|
||||
case MT_FAKEITEM:
|
||||
case MT_BANANAITEM:
|
||||
case MT_GREENITEM:
|
||||
case MT_REDITEM:
|
||||
case MT_REDITEMDUD:
|
||||
case MT_FIREBALL:
|
||||
// Remove stuff from death pits.
|
||||
if (P_CheckDeathPitCollide(mo))
|
||||
{
|
||||
|
@ -2329,13 +2337,6 @@ static boolean P_ZMovement(mobj_t *mo)
|
|||
case MT_FLINGCOIN:
|
||||
case MT_FLINGRANDOMITEM:
|
||||
case MT_FLINGEMERALD:
|
||||
// SRB2kart stuff that should die in pits
|
||||
case MT_RANDOMITEM:
|
||||
case MT_BANANAITEM:
|
||||
case MT_GREENITEM:
|
||||
case MT_REDITEM:
|
||||
case MT_REDITEMDUD:
|
||||
case MT_FIREBALL:
|
||||
// Remove flinged stuff from death pits.
|
||||
if (P_CheckDeathPitCollide(mo))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue