mauville-technologies / godot_dragonbones

Plugin module for Godot 2.1 & Godot 3 Game Engine to use DragonBones

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

3.x resource crash fix

NullptrEnjoyer opened this issue · comments

Due to some changes ( godotengine/godot#62408 ) this module does not work on later 3.x versions.

In the PR, an additional argument was added to the resource loading function, which seems to make the overriden version in this module make a different function instead of overriding the proper one, leading to an infinite loop because of how the load functions are set up. Probably.

Luckily, this can be easily fixed by a minor edit in the register_types.cpp file:

At line 34 of register_types.cpp there should be
virtual RES load(const String &p_path, const String &p_original_path, Error *r_error) {

Here you just have to add "bool p_no_subresource_cache = false" in the arguments, so it looks like
virtual RES load(const String &p_path, const String &p_original_path, Error *r_error, bool p_no_subresource_cache = false) {

It should no longer crash as we are now overriding the correct function. Note that if you're reverting to 3.2 for some reason you have to change it back (unless you do a proper fix but who has time for that amirite).