Skip to content

Commit

Permalink
Further work on disabling blood splats when dehacked
Browse files Browse the repository at this point in the history
See issue #848.
  • Loading branch information
bradharding committed Nov 29, 2024
1 parent a1fa5e1 commit ddd3d51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions src/d_deh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 2 additions & 3 deletions src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit ddd3d51

Please sign in to comment.