Editor: Don't allow variables with the same names as Resource props

This commit is contained in:
Serhii Snitsaruk 2024-01-29 10:32:32 +01:00
parent b4ab521e0f
commit 61ef929411
1 changed files with 3 additions and 0 deletions

View File

@ -159,6 +159,9 @@ String BlackboardPlan::get_var_name(const BBVariable &p_var) const {
}
bool BlackboardPlan::is_valid_var_name(const String &p_name) const {
if (p_name.begins_with("resource_")) {
return false;
}
return p_name.is_valid_identifier() && !var_map.has(p_name);
}