Skip to content

Commit

Permalink
Fix level kill/item totals if a SPAWNER attack fails
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Sep 18, 2023
1 parent bd8ea14 commit f26ce48
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,6 @@ Bugs fixed
- Fixed pre-EC legacy issue: Things were visible while changing positions via teleportation
- Fixed pre-EC legacy issue: Death from other means than the actual sector damage in a "death exit" sector would not
properly exit the level
- Fixed failed object spawns from a SPAWNER-type attack still counting toward the total amount of kills/items in a level


9 changes: 9 additions & 0 deletions source_files/edge/p_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "rad_trig.h"
#include "s_sound.h"
#include "w_wad.h"
#include "f_interm.h" // wi_stats

#include "AlmostEquals.h"

Expand Down Expand Up @@ -2334,6 +2335,10 @@ static void ObjectSpawning(mobj_t * parent, angle_t angle)
// Blocking line detected between object and spawnpoint?
if (P_MapCheckBlockingLine(parent, child))
{
if (child->flags & MF_COUNTKILL)
wi_stats.kills--;
if (child->flags & MF_COUNTITEM)
wi_stats.items--;
// -KM- 1999/01/31 Explode objects over remove them.
// -AJA- 2000/02/01: Remove now the default.
if (attack->flags & AF_KillFailedSpawn)
Expand All @@ -2350,6 +2355,10 @@ static void ObjectSpawning(mobj_t * parent, angle_t angle)
// If the object cannot move from its position, remove it or kill it.
if (!P_TryMove(child, child->x, child->y))
{
if (child->flags & MF_COUNTKILL)
wi_stats.kills--;
if (child->flags & MF_COUNTITEM)
wi_stats.items--;
if (attack->flags & AF_KillFailedSpawn)
P_KillMobj(parent, child, NULL);
else
Expand Down
2 changes: 1 addition & 1 deletion source_files/edge/p_mobj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,7 @@ mobj_t *P_MobjCreateObject(float x, float y, float z, const mobjtype_c *info)

if (level_flags.fastparm)
{
// MBF21: Use explicit Fast speed value if provided
// Use explicit Fast speed value if provided
if (info->fast_speed > -1)
mobj->speed = info->fast_speed;
else
Expand Down

0 comments on commit f26ce48

Please sign in to comment.