From 439d09059efbb6fcd1c8699b33cd27d42d8585f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Thu, 7 Aug 2025 18:34:48 -0300 Subject: [PATCH] turn assert into if --- src/playsim/a_dynlight.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/playsim/a_dynlight.cpp b/src/playsim/a_dynlight.cpp index 7e955fe58..c7eae0f18 100644 --- a/src/playsim/a_dynlight.cpp +++ b/src/playsim/a_dynlight.cpp @@ -671,9 +671,10 @@ void FDynamicLight::UnlinkLight() auto sidedef = touchlists.wall_tlist[i]; if (!sidedef) continue; - assert(Level->lightlists.wall_dlist.SSize() < sidedef->Index()); - - Level->lightlists.wall_dlist[sidedef->Index()].Remove(this); + if(Level->lightlists.wall_dlist.SSize() < sidedef->Index()) + { + Level->lightlists.wall_dlist[sidedef->Index()].Remove(this); + } } for(int i = 0; i < touchlists.flat_tlist.SSize(); i++) @@ -681,9 +682,10 @@ void FDynamicLight::UnlinkLight() auto sec = touchlists.flat_tlist[i]; if (!sec) continue; - assert(Level->lightlists.flat_dlist.SSize() < sec->Index()); - - Level->lightlists.flat_dlist[sec->Index()].Remove(this); + if(Level->lightlists.flat_dlist.SSize() < sec->Index()) + { + Level->lightlists.flat_dlist[sec->Index()].Remove(this); + } } touchlists.flat_tlist.Clear();