From cba7807053a5ea39fcaa280546e0e84fe232fea1 Mon Sep 17 00:00:00 2001 From: Nick Winter <livelily@gmail.com> Date: Fri, 31 Jan 2014 10:26:24 -0800 Subject: [PATCH] Possibly handling #133. --- app/lib/world/script_event_prereqs.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/lib/world/script_event_prereqs.coffee b/app/lib/world/script_event_prereqs.coffee index 52ed3f9b9..ee56ca778 100644 --- a/app/lib/world/script_event_prereqs.coffee +++ b/app/lib/world/script_event_prereqs.coffee @@ -10,9 +10,9 @@ 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.containingRegexp? and v?.search(new RegExp(ap.containingRegexp)) == -1 - return false if ap.notContainingRegexp? and v?.search(new RegExp(ap.notContainingRegexp)) != -1 + return false if ap.containingString? and not v or v.search(ap.containingString) is -1 + return false if ap.notContainingString? and v?.search(ap.containingString) isnt -1 + return false if ap.containingRegexp? and not v or v.search(new RegExp(ap.containingRegexp)) is -1 + return false if ap.notContainingRegexp? and v?.search(new RegExp(ap.notContainingRegexp)) isnt -1 - return true \ No newline at end of file + return true