[GDnative] Improve inheritance system in gdnative pluginscript #15761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently parent class is passed to pluginscript by it name, which is not a good idea:
vehicle/ai.xx
andhuman/ai.xx
, assuming.xx
is a pluginscript-powered script language)Node2D
)To solve this, pluginscript consider plain name as default Godot class, and otherwise wants a path (i.e.
res://vehicle/ai.xx
) as parent class attribute.This way it even allow to inherit from another type of script !
ha ! and this PR also fix memory leaks with forgotten destructor. BTW I don't know if there is a better way to pass data returned from the binding without having to recreate another instance configured through pointer casting, I've tried to use
reinterpret_cast
but without any luck...