WeaselGames / godot_luaAPI

Godot LuaAPI
https://luaapi.weaselgames.info
Other
361 stars 27 forks source link

Lua `nil` as analog value to GDScript `null` value? #133

Closed vitawrap closed 1 year ago

vitawrap commented 1 year ago

hello it's me again

Is your feature request related to a problem? Please describe. I've noticed GDScript methods that can return null will push values to the Lua state that still translate to an userdata.

Describe the solution you'd like As the title suggests, it would be correct to make an exception for GDScript null values to be translated as nil in the lua state.

Describe alternatives you've considered An alternative that I assume could work is, without means to perform this within Lua, a global function exposed from GDScript that copares its input with an internal null value... But that rules out intuitiveness for scripts that I or others would write, and definitely creates verbosity. It is a design I would much like to avoid, I hope it's understandable.

vitawrap commented 1 year ago

ah I see that there is a check in push_variant which uses the now deprecated Nil type. This should be changed for 4.x