Fixed WalkStepTics & RunStepTics in terrain parser
Fixed the discrepancy where WalkStepTics and RunStepTics were called, well, that. In the terrain struct in both C++ and ZScript. While the terrain parser looked for WALKINGSTEPTIME and RUNNINGSTEPTIME instead. Also made the parse not multiply these time values by the ticrate to treat them as seconds instead of tics. Added flags for P_HitWater(). Added optional overridable footsteps for players. Added an overridable MakeFootsteps() virtual in PlayerPawn. Which allows for adding totally custom footstep logic for players. By default, it comes with a basic footstep system that uses the footstep properties of whatever terrain the pawn is standing on. bMakeFootsteps must be enabled on the pawn for the virtual to run. Added generic StepSound TERRAIN property. Added a generic step sound TERRAIN property, for defining foot-agnostic step sounds. Used by the built-in footstep system over the individual foot ones. Simplified MakeFootsteps(). Also removed a leftover debug message.
This commit is contained in:
parent
8e4080f8d1
commit
12d1afcc4e
8 changed files with 76 additions and 12 deletions
|
|
@ -6631,7 +6631,13 @@ int P_GetThingFloorType (AActor *thing)
|
|||
// Returns true if hit liquid and splashed, false if not.
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
bool P_HitWater (AActor * thing, sector_t * sec, const DVector3 &pos, bool checkabove, bool alert, bool force)
|
||||
enum HitWaterFlags
|
||||
{
|
||||
THW_SMALL = 1 << 0,
|
||||
THW_NOVEL = 1 << 1,
|
||||
};
|
||||
|
||||
bool P_HitWater (AActor * thing, sector_t * sec, const DVector3 &pos, bool checkabove, bool alert, bool force, int flags)
|
||||
{
|
||||
if (thing->player && (thing->player->cheats & CF_PREDICTING))
|
||||
return false;
|
||||
|
|
@ -6719,13 +6725,13 @@ foundone:
|
|||
|
||||
// Don't splash for living things with small vertical velocities.
|
||||
// There are levels where the constant splashing from the monsters gets extremely annoying
|
||||
if (((thing->flags3&MF3_ISMONSTER || thing->player) && thing->Vel.Z >= -6) && !force)
|
||||
if (!(flags & THW_NOVEL) && ((thing->flags3 & MF3_ISMONSTER || thing->player) && thing->Vel.Z >= -6) && !force)
|
||||
return Terrains[terrainnum].IsLiquid;
|
||||
|
||||
splash = &Splashes[splashnum];
|
||||
|
||||
// Small splash for small masses
|
||||
if (thing->Mass < 10)
|
||||
if (flags & THW_SMALL || thing->Mass < 10)
|
||||
smallsplash = true;
|
||||
|
||||
if (!(thing->flags3 & MF3_DONTSPLASH))
|
||||
|
|
@ -6790,7 +6796,8 @@ DEFINE_ACTION_FUNCTION(AActor, HitWater)
|
|||
PARAM_BOOL(checkabove);
|
||||
PARAM_BOOL(alert);
|
||||
PARAM_BOOL(force);
|
||||
ACTION_RETURN_BOOL(P_HitWater(self, sec, DVector3(x, y, z), checkabove, alert, force));
|
||||
PARAM_INT(flags);
|
||||
ACTION_RETURN_BOOL(P_HitWater(self, sec, DVector3(x, y, z), checkabove, alert, force, flags));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue