mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 19:22:56 +00:00
fixed ntscript smartfind's bounds check
This commit is contained in:
@@ -101,13 +101,13 @@
|
|||||||
if(haystack && needle)
|
if(haystack && needle)
|
||||||
if(isobject(haystack))
|
if(isobject(haystack))
|
||||||
if(istype(haystack, /list))
|
if(istype(haystack, /list))
|
||||||
if(length(haystack) >= end && start > 0)
|
if(length(haystack) + 1 >= end && start > 0)
|
||||||
var/list/listhaystack = haystack
|
var/list/listhaystack = haystack
|
||||||
return listhaystack.Find(needle, start, end)
|
return listhaystack.Find(needle, start, end)
|
||||||
|
|
||||||
else
|
else
|
||||||
if(istext(haystack))
|
if(istext(haystack))
|
||||||
if(length(haystack) >= end && start > 0)
|
if(length(haystack) + 1 >= end && start > 0)
|
||||||
return findtext(haystack, needle, start, end)
|
return findtext(haystack, needle, start, end)
|
||||||
|
|
||||||
// Clone of copytext()
|
// Clone of copytext()
|
||||||
|
|||||||
Reference in New Issue
Block a user