From 381d2bcd73eaa18aba12c62beb82eb7365b92580 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 1 Nov 2020 12:17:40 +0200 Subject: [PATCH] - do not keep impact decal that fails to stick to a wall Such invisible decals were not taken into account when calculating their total number Changing cl_maxdecals CVAR may not work as expected because of limit counter's inconsistent value https://forum.zdoom.org/viewtopic.php?t=70457 --- src/playsim/a_decals.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/playsim/a_decals.cpp b/src/playsim/a_decals.cpp index 24fbaca6c..9cce79275 100644 --- a/src/playsim/a_decals.cpp +++ b/src/playsim/a_decals.cpp @@ -755,6 +755,7 @@ DImpactDecal *DImpactDecal::StaticCreate (FLevelLocals *Level, const FDecalTempl if (!decal->StickToWall (wall, pos.X, pos.Y, ffloor).isValid()) { + decal->Destroy(); return NULL; } decal->CheckMax();