From 2383d5dd3a8281ffd7bacd43a1967fe4b6c78ffb Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Fri, 10 Jan 2014 17:04:12 -0800 Subject: [PATCH] An improvement for containingString in #133. --- app/lib/world/script_event_prereqs.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/world/script_event_prereqs.coffee b/app/lib/world/script_event_prereqs.coffee index 25b1dc47d..fa250f7ce 100644 --- a/app/lib/world/script_event_prereqs.coffee +++ b/app/lib/world/script_event_prereqs.coffee @@ -10,7 +10,7 @@ module.exports.scriptMatchesEventPrereqs = scriptMatchesEventPrereqs = (script, return false if ap.greaterThanOrEqualTo? and not (v >= ap.greaterThanOrEqualTo) return false if ap.lessThan? and not (v < ap.lessThan) return false if ap.lessThanOrEqualTo? and not (v <= ap.lessThanOrEqualTo) - return false if ap.containingString? and v.search(ap.containingString) == -1 - return false if ap.notContainingString? and v.search(ap.containingString) != -1 + return false if ap.containingString? and v?.search(ap.containingString) == -1 + return false if ap.notContainingString? and v?.search(ap.containingString) != -1 return true