From e1fece081f1a84cceacd616fa3c5ff9592529ec2 Mon Sep 17 00:00:00 2001 From: AnturK Date: Fri, 8 Dec 2017 16:32:56 +0100 Subject: [PATCH] Limit bullet overlays on walls (#33364) * Limit bullet overlays on walls * Whitespace bad * Okay * Touching this because I'm testing TGS3 stuff * Update walls.dm --- code/game/turfs/simulated/walls.dm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 6d8db55ad8..337bb051a8 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -1,3 +1,5 @@ +#define MAX_DENT_DECALS 15 + /turf/closed/wall name = "wall" desc = "A huge chunk of metal used to separate rooms." @@ -297,6 +299,9 @@ return FALSE /turf/closed/wall/proc/add_dent(denttype, x=rand(-8, 8), y=rand(-8, 8)) + if(LAZYLEN(dent_decals) >= MAX_DENT_DECALS) + return + var/mutable_appearance/decal = pick(dent_decal_list[denttype]) decal.pixel_x = x decal.pixel_y = y @@ -304,3 +309,5 @@ cut_overlay(dent_decals) LAZYADD(dent_decals, decal) add_overlay(dent_decals) + +#undef MAX_DENT_DECALS