Skip to content

Commit

Permalink
Remove blood splat if total equals max
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Jul 4, 2016
1 parent e9734df commit d78264a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ void P_SpawnBloodSplat(fixed_t x, fixed_t y, int blood, int maxheight, mobj_t *t
newsplat->sprite = SPR_BLD2;
newsplat->frame = rand() & 7;

newsplat->flags2 = (MF2_DONOTMAP | (rand() & 1) * MF2_MIRRORED);
newsplat->flags2 = (MF2_DONOTMAP | ((rand() & 1) * MF2_MIRRORED));
if (blood == FUZZYBLOOD)
{
newsplat->flags = MF_FUZZ;
Expand All @@ -1228,7 +1228,7 @@ void P_SpawnBloodSplat(fixed_t x, fixed_t y, int blood, int maxheight, mobj_t *t
newsplat->subsector = subsec;
P_SetBloodSplatPosition(newsplat);

if (r_bloodsplats_total > r_bloodsplats_max)
if (r_bloodsplats_total >= r_bloodsplats_max)
{
mobj_t *oldsplat = bloodsplats[r_bloodsplats_total % r_bloodsplats_max];

Expand All @@ -1240,7 +1240,6 @@ void P_SpawnBloodSplat(fixed_t x, fixed_t y, int blood, int maxheight, mobj_t *t
else
bloodsplats[r_bloodsplats_total++ % r_bloodsplats_max] = newsplat;


if (target)
target->bloodsplats = MAX(0, target->bloodsplats - 1);
}
Expand Down

0 comments on commit d78264a

Please sign in to comment.