1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

[MP] Add warnings to spawner and synchronizer.

MultiplayerSpawner:
- When spawn_path is invalid.
- When the auto spawn list is empty and _spawn_custom is not overridden.
  Note: We remove the warning for placeholder scripts since there's no
  way of knowing if they have a certain method.

MultiplayerSynchronizer:
- When root_path is invalid.
This commit is contained in:
Fabio Alessandrelli
2022-09-16 22:42:05 +02:00
parent 57bdddce02
commit ba6f5471c4
4 changed files with 34 additions and 0 deletions

View File

@@ -94,6 +94,16 @@ void MultiplayerSynchronizer::_update_process() {
}
}
TypedArray<String> MultiplayerSynchronizer::get_configuration_warnings() const {
TypedArray<String> warnings = Node::get_configuration_warnings();
if (root_path.is_empty() || !has_node(root_path)) {
warnings.push_back(RTR("A valid NodePath must be set in the \"Root Path\" property in order for MultiplayerSynchronizer to be able to synchronize properties."));
}
return warnings;
}
Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Object *p_obj, Vector<Variant> &r_variant, Vector<const Variant *> &r_variant_ptrs) {
ERR_FAIL_COND_V(!p_obj, ERR_INVALID_PARAMETER);
r_variant.resize(p_properties.size());