From 1224d1da77d1e8a1d26b8e3f802b5c976f5f1f29 Mon Sep 17 00:00:00 2001 From: Tastyfish Date: Thu, 15 Mar 2012 20:23:49 -0400 Subject: [PATCH] fixed ntscript smartfind's bounds check --- code/modules/scripting/Implementations/_Logic.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/scripting/Implementations/_Logic.dm b/code/modules/scripting/Implementations/_Logic.dm index f954cf0341..a76f4006e1 100644 --- a/code/modules/scripting/Implementations/_Logic.dm +++ b/code/modules/scripting/Implementations/_Logic.dm @@ -101,13 +101,13 @@ if(haystack && needle) if(isobject(haystack)) if(istype(haystack, /list)) - if(length(haystack) >= end && start > 0) + if(length(haystack) + 1 >= end && start > 0) var/list/listhaystack = haystack return listhaystack.Find(needle, start, end) else if(istext(haystack)) - if(length(haystack) >= end && start > 0) + if(length(haystack) + 1 >= end && start > 0) return findtext(haystack, needle, start, end) // Clone of copytext()