Merge pull request #56299 from raulsntos/fix-37812

Fix getting properties state when reloading C#
This commit is contained in:
Ignacio Roldán Etcheverry 2021-12-29 00:14:23 +01:00 committed by GitHub
commit be665ddff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1762,7 +1762,16 @@ void CSharpInstance::get_properties_state_for_reloading(List<Pair<StringName, Va
ManagedType managedType;
GDMonoField *field = script->script_class->get_field(state_pair.first);
GDMonoField *field = nullptr;
GDMonoClass *top = script->script_class;
while (top && top != script->native) {
field = top->get_field(state_pair.first);
if (field) {
break;
}
top = top->get_parent_class();
}
if (!field) {
continue; // Properties ignored. We get the property baking fields instead.
}