diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index e8e6526fff7..7a12af92611 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -255,7 +255,12 @@ var/list/textList = new() var/searchPosition = 1 var/findPosition = 1 + var/loops = 0 while(1) + if(loops >= 1000) + break + loops++ + findPosition = findtext(text, separator, searchPosition, 0) var/buggyText = copytext(text, searchPosition, findPosition) if(!withinList || (buggyText in withinList)) textList += "[buggyText]"