Issue #1195 - Standing at a corner under steam, but far away enough to not be impacted by it, causes the player animation to reset for a tic

This commit is contained in:
SSNTails 2024-02-15 12:42:31 -05:00
parent fa690e0190
commit fdb94b15ea
4 changed files with 30 additions and 31 deletions

View file

@ -7493,12 +7493,12 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
sfx_steam1, // deathsound
0, // speed
32*FRACUNIT, // radius
1*FRACUNIT, // height
16*FRACUNIT, // height
0, // display offset
20*FRACUNIT, // mass
0, // damage
sfx_None, // activesound
MF_SOLID, // flags
MF_SPECIAL, // flags
S_NULL // raisestate
},

View file

@ -5177,7 +5177,7 @@ void A_SetSolidSteam(mobj_t *actor)
return;
actor->flags &= ~MF_NOCLIP;
actor->flags |= MF_SOLID;
actor->flags |= MF_SPECIAL;
if (!(actor->flags2 & MF2_AMBUSH))
{
if (P_RandomChance(FRACUNIT/8))
@ -5207,7 +5207,7 @@ void A_UnsetSolidSteam(mobj_t *actor)
if (LUA_CallAction(A_UNSETSOLIDSTEAM, actor))
return;
actor->flags &= ~MF_SOLID;
actor->flags &= ~MF_SPECIAL;
actor->flags |= MF_NOCLIP;
}

View file

@ -1878,6 +1878,21 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
toucher->tracer->flags2 = (toucher->tracer->flags2 & ~MF2_AMBUSH) | destambush;
}
return;
case MT_STEAM: // Steam
fixed_t speed = special->info->mass; // conveniently, both fans and gas jets use this for the vertical thrust
SINT8 flipval = P_MobjFlip(special); // virtually everything here centers around the thruster's gravity, not the object's!
if (special->state != &states[S_STEAM1]) // Only when it bursts
break;
toucher->eflags |= MFE_SPRUNG;
toucher->momz = flipval * FixedMul(speed, FixedSqrt(FixedMul(special->scale, toucher->scale))); // scale the speed with both objects' scales, just like with springs!
P_ResetPlayer(player);
if (player->panim != PA_FALL)
P_SetMobjState(toucher, S_PLAY_FALL);
return;
default: // SOC or script pickup
if (player->bot && player->bot != BOT_MPAI)
return;

View file

@ -502,7 +502,7 @@ springstate:
return final;
}
static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
static void P_DoFan(mobj_t *spring, mobj_t *object)
{
player_t *p = object->player; // will be NULL if not a player
fixed_t zdist; // distance between bottoms
@ -552,22 +552,6 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
p->powers[pw_carry] = CR_FAN;
}
break;
case MT_STEAM: // Steam
if (zdist > FixedMul(16*FRACUNIT, spring->scale))
break;
if (spring->state != &states[S_STEAM1]) // Only when it bursts
break;
object->eflags |= MFE_SPRUNG;
object->momz = flipval*FixedMul(speed, FixedSqrt(FixedMul(spring->scale, object->scale))); // scale the speed with both objects' scales, just like with springs!
if (p)
{
P_ResetPlayer(p);
if (p->panim != PA_FALL)
P_SetMobjState(object, S_PLAY_FALL);
}
break;
default:
break;
}
@ -1578,15 +1562,15 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
if (thing->flags & MF_PUSHABLE)
{
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
P_DoFanAndGasJet(tmthing, thing);
if (tmthing->type == MT_FAN)
P_DoFan(tmthing, thing);
}
if (tmthing->flags & MF_PUSHABLE)
{
if (thing->type == MT_FAN || thing->type == MT_STEAM)
if (thing->type == MT_FAN)
{
P_DoFanAndGasJet(thing, tmthing);
P_DoFan(thing, tmthing);
return CHECKTHING_COLLIDE;
}
else if (thing->flags & MF_SPRING)
@ -1679,8 +1663,8 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
}
}
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
P_DoFanAndGasJet(tmthing, thing);
if (tmthing->type == MT_FAN)
P_DoFan(tmthing, thing);
}
if (tmthing->player) // Is the moving/interacting object the player?
@ -1688,8 +1672,8 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
if (!tmthing->health)
return CHECKTHING_IGNORE;
if (thing->type == MT_FAN || thing->type == MT_STEAM)
P_DoFanAndGasJet(thing, tmthing);
if (thing->type == MT_FAN)
P_DoFan(thing, tmthing);
else if (thing->flags & MF_SPRING && tmthing->player->powers[pw_carry] != CR_MINECART)
{
if ( thing->z <= tmthing->z + tmthing->height
@ -1755,8 +1739,8 @@ static unsigned PIT_DoCheckThing(mobj_t *thing)
// not solid not blocked
unsigned collide = CHECKTHING_NOCOLLIDE;
if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM || tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) && (thing->player))
; // springs, gas jets and springs should never be able to step up onto a player
if ((tmthing->flags & MF_SPRING || tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) && (thing->player))
; // springs should never be able to step up onto a player
// z checking at last
// Treat noclip things as non-solid!
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID