Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit cf67462

Browse files
authored
Merge pull request #16302 from inky03/yippee-2
support passing Object to lua
2 parents d0df09f + 1ce11f3 commit cf67462

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

source/psychlua/HScript.hx

+2-2
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ class HScript extends Iris
356356
final retVal:IrisCall = funk.hscript.call(funcToRun, funcArgs);
357357
if (retVal != null)
358358
{
359-
return (retVal.returnValue == null || LuaUtils.isOfTypes(retVal.returnValue, [Bool, Int, Float, String, Array])) ? retVal.returnValue : null;
359+
return (LuaUtils.isLuaSupported(retVal.returnValue)) ? retVal.returnValue : null;
360360
}
361361
else if (funk.hscript.returnValue != null)
362362
{
@@ -372,7 +372,7 @@ class HScript extends Iris
372372
final retVal:IrisCall = funk.hscript.call(funcToRun, funcArgs);
373373
if (retVal != null)
374374
{
375-
return (retVal.returnValue == null || LuaUtils.isOfTypes(retVal.returnValue, [Bool, Int, Float, String, Array])) ? retVal.returnValue : null;
375+
return (LuaUtils.isLuaSupported(retVal.returnValue)) ? retVal.returnValue : null;
376376
}
377377
}
378378
else

source/psychlua/LuaUtils.hx

+3
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ class LuaUtils
264264
}
265265
return false;
266266
}
267+
public static function isLuaSupported(value:Any):Bool {
268+
return (value == null || isOfTypes(value, [Bool, Int, Float, String, Array]) || Type.typeof(value) == ValueType.TObject);
269+
}
267270

268271
public static function getTargetInstance()
269272
{

0 commit comments

Comments
 (0)