mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 21:51:22 +00:00 
			
		
		
		
	Add templated version of ObjectDB::get_instance()
This commit is contained in:
		
							parent
							
								
									594d64ec24
								
							
						
					
					
						commit
						bc9d0c7835
					
				
					 49 changed files with 121 additions and 104 deletions
				
			
		|  | @ -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()); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 kobewi
						kobewi