Browse Source

Fix assignment with operator on type member

Julien Nguyen 4 năm trước cách đây
mục cha
commit
9bc5119d4e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      modules/gdscript/gdscript_compiler.cpp

+ 1 - 1
modules/gdscript/gdscript_compiler.cpp

@@ -951,7 +951,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code
 
 				// Perform operator if any.
 				if (assignment->operation != GDScriptParser::AssignmentNode::OP_NONE) {
-					GDScriptCodeGenerator::Address value = codegen.add_temporary();
+					GDScriptCodeGenerator::Address value = codegen.add_temporary(_gdtype_from_datatype(subscript->get_datatype()));
 					if (subscript->is_attribute) {
 						gen->write_get_named(value, name, prev_base);
 					} else {