diff --git a/buildnumber.txt b/buildnumber.txt index 7625ffc2..9d8d09f2 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1437 \ No newline at end of file +1438 \ No newline at end of file diff --git a/source/funkin/scripting/HScript.hx b/source/funkin/scripting/HScript.hx index 6b78a565..e305d869 100644 --- a/source/funkin/scripting/HScript.hx +++ b/source/funkin/scripting/HScript.hx @@ -75,7 +75,7 @@ class HScript extends Script { if (interp == null) return null; var func = interp.variables.get(funcName); - if (Reflect.isFunction(func)) + if (func != null && Reflect.isFunction(func)) return (parameters != null && parameters.length > 0) ? Reflect.callMethod(null, func, parameters) : func(); return null; diff --git a/source/funkin/scripting/ScriptPack.hx b/source/funkin/scripting/ScriptPack.hx index f704900d..0562a6e0 100644 --- a/source/funkin/scripting/ScriptPack.hx +++ b/source/funkin/scripting/ScriptPack.hx @@ -66,7 +66,7 @@ class ScriptPack extends Script { for(e in scripts) { e.call(func, [event]); @:privateAccess - if (event.cancelled && event.__continueCalls) break; + if (event.cancelled && !event.__continueCalls) break; } return event; } diff --git a/source/funkin/scripting/events/CancellableEvent.hx b/source/funkin/scripting/events/CancellableEvent.hx index 8b52f950..8aa998e0 100644 --- a/source/funkin/scripting/events/CancellableEvent.hx +++ b/source/funkin/scripting/events/CancellableEvent.hx @@ -16,7 +16,7 @@ class CancellableEvent { * Prevents default action from occuring. * @param c Whenever the scripts following this one should be called or not. (Defaults to `true`) */ - public function preventDefault(c:Bool = true) { + public function preventDefault(c:Bool = false) { cancelled = true; __continueCalls = c; } diff --git a/source/funkin/system/AssetsLibraryList.hx b/source/funkin/system/AssetsLibraryList.hx index 0b4358b8..b7c95dbe 100644 --- a/source/funkin/system/AssetsLibraryList.hx +++ b/source/funkin/system/AssetsLibraryList.hx @@ -24,9 +24,12 @@ class AssetsLibraryList extends AssetLibrary { public override function getPath(id:String) { for(e in libraries) { - var path = e.getPath(id); - if (path != null) - return path; + @:privateAccess + if (e.exists(id, e.types.get(id))) { + var path = e.getPath(id); + if (path != null) + return path; + } } return null; } diff --git a/source/funkin/system/Paths.hx b/source/funkin/system/Paths.hx index cf2a8810..e21306b1 100644 --- a/source/funkin/system/Paths.hx +++ b/source/funkin/system/Paths.hx @@ -57,7 +57,7 @@ class Paths { return 'assets/$file'; } - + inline static public function file(file:String, type:AssetType = TEXT, ?library:String) { return getPath(file, type, library);