Skip to content

Commit

Permalink
Merge pull request godotengine#79479 from Faless/mp/get_set_indexed
Browse files Browse the repository at this point in the history
[MP] Use `get/set_indexed` in MultiplayerSynchronizer
  • Loading branch information
YuriSizov committed Jul 18, 2023
2 parents 182b94c + b6dc799 commit 5a565e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/multiplayer/multiplayer_synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Obj
bool valid = false;
const Object *obj = _get_prop_target(p_obj, prop);
ERR_FAIL_COND_V(!obj, FAILED);
r_variant.write[i] = obj->get(prop.get_concatenated_subnames(), &valid);
r_variant.write[i] = obj->get_indexed(prop.get_subnames(), &valid);
r_variant_ptrs.write[i] = &r_variant[i];
ERR_FAIL_COND_V_MSG(!valid, ERR_INVALID_DATA, vformat("Property '%s' not found.", prop));
i++;
Expand All @@ -171,7 +171,7 @@ Error MultiplayerSynchronizer::set_state(const List<NodePath> &p_properties, Obj
for (const NodePath &prop : p_properties) {
Object *obj = _get_prop_target(p_obj, prop);
ERR_FAIL_COND_V(!obj, FAILED);
obj->set(prop.get_concatenated_subnames(), p_state[i]);
obj->set_indexed(prop.get_subnames(), p_state[i]);
i += 1;
}
return OK;
Expand Down

0 comments on commit 5a565e0

Please sign in to comment.