You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add templated version of ObjectDB::get_instance()
This commit is contained in:
@@ -154,7 +154,7 @@ void SceneCacheInterface::process_confirm_path(int p_from, const uint8_t *p_pack
|
||||
}
|
||||
|
||||
if (valid_rpc_checksum == false) {
|
||||
const Node *node = Object::cast_to<Node>(ObjectDB::get_instance(*oid));
|
||||
const Node *node = ObjectDB::get_instance<Node>(*oid);
|
||||
ERR_FAIL_NULL(node); // Bug.
|
||||
ERR_PRINT("The rpc node checksum failed. Make sure to have the same methods on both nodes. Node path: " + node->get_path());
|
||||
}
|
||||
@@ -280,7 +280,7 @@ Object *SceneCacheInterface::get_cached_object(int p_from, uint32_t p_cache_id)
|
||||
|
||||
RecvNode *recv_node = pinfo->recv_nodes.getptr(p_cache_id);
|
||||
ERR_FAIL_NULL_V_MSG(recv_node, nullptr, vformat("ID %d not found in cache of peer %d.", p_cache_id, p_from));
|
||||
Node *node = Object::cast_to<Node>(ObjectDB::get_instance(recv_node->oid));
|
||||
Node *node = ObjectDB::get_instance<Node>(recv_node->oid);
|
||||
if (!node) {
|
||||
// Fallback to path lookup.
|
||||
Node *root_node = SceneTree::get_singleton()->get_root()->get_node(multiplayer->get_root_path());
|
||||
|
||||
Reference in New Issue
Block a user