You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Fix resolution of dictionary keys
There was a mixup between String and StringName keys. Now they're clearly separated. This also means you have to consider which type you're using for the dictionary keys and how you are accessing them.
This commit is contained in:
@@ -680,9 +680,9 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
|
||||
name = subscript->attribute->name;
|
||||
named = true;
|
||||
} else {
|
||||
if (subscript->index->type == GDScriptParser::Node::LITERAL && static_cast<const GDScriptParser::LiteralNode *>(subscript->index)->value.get_type() == Variant::STRING) {
|
||||
if (subscript->index->is_constant && subscript->index->reduced_value.get_type() == Variant::STRING_NAME) {
|
||||
// Also, somehow, named (speed up anyway).
|
||||
name = static_cast<const GDScriptParser::LiteralNode *>(subscript->index)->value;
|
||||
name = subscript->index->reduced_value;
|
||||
named = true;
|
||||
} else {
|
||||
// Regular indexing.
|
||||
|
||||
Reference in New Issue
Block a user