You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Check if global class file still exists before registering it
(cherry picked from commit e264ae20d2)
This commit is contained in:
committed by
Rémi Verschelde
parent
36b746d903
commit
4f9ca00294
@@ -31,6 +31,7 @@
|
|||||||
#include "script_language.h"
|
#include "script_language.h"
|
||||||
|
|
||||||
#include "core/core_string_names.h"
|
#include "core/core_string_names.h"
|
||||||
|
#include "core/os/file_access.h"
|
||||||
#include "core/project_settings.h"
|
#include "core/project_settings.h"
|
||||||
|
|
||||||
ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES];
|
ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES];
|
||||||
@@ -166,7 +167,7 @@ void ScriptServer::init_languages() {
|
|||||||
|
|
||||||
for (int i = 0; i < script_classes.size(); i++) {
|
for (int i = 0; i < script_classes.size(); i++) {
|
||||||
Dictionary c = script_classes[i];
|
Dictionary c = script_classes[i];
|
||||||
if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base"))
|
if (!c.has("class") || !c.has("language") || !c.has("path") || !FileAccess::exists(c["path"]) || !c.has("base"))
|
||||||
continue;
|
continue;
|
||||||
add_global_class(c["class"], c["base"], c["language"], c["path"]);
|
add_global_class(c["class"], c["base"], c["language"], c["path"]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user