Skip to content

Commit

Permalink
instanceArg fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LarryFrosty committed Sep 7, 2024
1 parent d6cedc3 commit 60636f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/psychlua/ReflectionFunctions.hx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ class ReflectionFunctions

static function parseInstances(args:Array<Dynamic>)
{
if (args == null) return [];
for (i in 0...args.length)
{
var myArg:String = cast args[i];
Expand All @@ -200,8 +201,8 @@ class ReflectionFunctions
//trace('Op1: $myArg');
var lastIndex:Int = myArg.lastIndexOf('::');

var split:Array<String> = myArg.split('.');
args[i] = (lastIndex > -1) ? Type.resolveClass(myArg.substring(0, lastIndex)) : PlayState.instance;
var split:Array<String> = 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]}');
Expand Down

0 comments on commit 60636f4

Please sign in to comment.