From 323e2ef995a9e6dab7cd04c2dd09b23bf9bb617a Mon Sep 17 00:00:00 2001 From: LarryFrosty <80482125+LarryFrosty@users.noreply.github.com> Date: Sun, 28 Apr 2024 11:34:07 +0800 Subject: [PATCH] Fix `instanceArg' second argument --- source/psychlua/ReflectionFunctions.hx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/psychlua/ReflectionFunctions.hx b/source/psychlua/ReflectionFunctions.hx index 13b1adb6793..8c0dadf4a67 100644 --- a/source/psychlua/ReflectionFunctions.hx +++ b/source/psychlua/ReflectionFunctions.hx @@ -189,6 +189,7 @@ class ReflectionFunctions static function parseInstances(args:Array) { + if (args == null) return []; for (i in 0...args.length) { var myArg:String = cast args[i]; @@ -201,8 +202,8 @@ class ReflectionFunctions //trace('Op1: $myArg'); var lastIndex:Int = myArg.lastIndexOf('::'); - var split:Array = myArg.split('.'); - args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(0, lastIndex)) : PlayState.instance; + var split:Array = (lastIndex > -1) ? myArg.substring(0, lastIndex).split('.') : myArg.split('.'); + args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(lastIndex+2)) : PlayState.instance; for (j in 0...split.length) { //trace('Op2: ${Type.getClass(args[i])}, ${split[j]}');