From ddd3d51f5c28f54b36ca858994ea38fcdacdc4a7 Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Fri, 29 Nov 2024 17:07:09 +1100 Subject: [PATCH] Further work on disabling blood splats when dehacked See issue #848. --- releasenotes.md | 1 + src/d_deh.c | 2 ++ src/d_deh.h | 1 + src/p_mobj.c | 5 ++--- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/releasenotes.md b/releasenotes.md index ee9e40758..a712277e4 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -39,6 +39,7 @@ * These changes have been made to the support of `DEHACKED` lumps: * A bug is fixed whereby a line wouldn’t be parsed in some instances if the previous line was blank. * If the fists or chainsaw are replaced using `WEAPON`, that weapon can now consume ammo. + * Blood splats are no longer spawned if the states of blood have been changed. * The [fake contrast](https://doomwiki.org/wiki/Fake_contrast) applied to walls at different angles is now more varied. * A bug is fixed whereby the player’s aim was slightly lower when the `freelook` CVAR was `on` and the `r_screensize` CVAR was `8`. * These changes have been made to the alternate widescreen HUD: diff --git a/src/d_deh.c b/src/d_deh.c index 085593919..0fc739fbc 100644 --- a/src/d_deh.c +++ b/src/d_deh.c @@ -71,6 +71,7 @@ static int linecount; int dehcount = 0; int dehmaptitlecount = 0; bool dehacked = false; +bool nobloodsplats = false; bool norockettrails = false; extern byte *defined_codeptr_args; @@ -4544,6 +4545,7 @@ void D_PostProcessDeh(void) states[i].args[j] = bexptr_match->default_args[j]; } + nobloodsplats = (states[S_BLOOD3].nextstate != S_NULL); norockettrails |= (states[S_TRAIL].dehacked || states[S_TRAIL2].dehacked || states[S_TRAIL3].dehacked || states[S_TRAIL4].dehacked); diff --git a/src/d_deh.h b/src/d_deh.h index 195ce976e..960d0b010 100644 --- a/src/d_deh.h +++ b/src/d_deh.h @@ -558,6 +558,7 @@ extern const int nummapnamesn; extern int dehcount; extern int dehmaptitlecount; +extern bool nobloodsplats; extern bool norockettrails; void D_ProcessDehFile(char *filename, int lumpnum, bool autoloaded); diff --git a/src/p_mobj.c b/src/p_mobj.c index bb98f971d..eaf0c3c22 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -465,8 +465,7 @@ static void P_ZMovement(mobj_t *mo) if (mo->z <= floorz) { // [BH] remove blood the moment it hits the ground and spawn blood splats in its place - if ((mo->type == MT_BLOOD && states[S_BLOOD3].nextstate == S_NULL) - || (SD21 && mo->sprite == 383)) + if ((mo->type == MT_BLOOD && !nobloodsplats) || (SD21 && mo->sprite == 383)) { P_RemoveBloodMobj(mo); @@ -1584,7 +1583,7 @@ void P_SetBloodSplatColor(bloodsplat_t *splat) void P_SpawnBloodSplat(const fixed_t x, const fixed_t y, const int color, const bool usemaxheight, const bool checklineside, const fixed_t maxheight, mobj_t *target) { - if (r_bloodsplats_total < r_bloodsplats_max) + if (r_bloodsplats_total < r_bloodsplats_max && !nobloodsplats) { sector_t *sec = R_PointInSubsector(x, y)->sector;