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