mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-04 07:31:16 +00:00 
			
		
		
		
	check for cyclic inheritance when adding a global class
This commit is contained in:
		
							parent
							
								
									98497ff719
								
							
						
					
					
						commit
						d8b36a452c
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
					@ -218,6 +218,7 @@ void ScriptServer::global_classes_clear() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void ScriptServer::add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path) {
 | 
					void ScriptServer::add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path) {
 | 
				
			||||||
 | 
						ERR_FAIL_COND_MSG(p_class == p_base || (global_classes.has(p_base) && get_global_class_native_base(p_base) == p_class), "Cyclic inheritance in script class.");
 | 
				
			||||||
	GlobalScriptClass g;
 | 
						GlobalScriptClass g;
 | 
				
			||||||
	g.language = p_language;
 | 
						g.language = p_language;
 | 
				
			||||||
	g.path = p_path;
 | 
						g.path = p_path;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue