From f9c472c4eefe1b2201cbc2f58230417ad1d46ca0 Mon Sep 17 00:00:00 2001 From: "vageyenaman@gmail.com" Date: Sun, 8 Apr 2012 18:34:56 +0000 Subject: [PATCH] Hopefully should fix some crashing for NTSL. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3413 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/procs/helpers.dm | 5 +++++ 1 file changed, 5 insertions(+) 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]"