Merge pull request #44424 from briansemrau/gdscript-fix-and

Fix gdscript `and` operator
This commit is contained in:
Rémi Verschelde 2020-12-16 14:42:56 +01:00 committed by GitHub
commit 88b8c3ec00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -428,7 +428,7 @@ void GDScriptByteCodeGenerator::write_end_and(const Address &p_target) {
patch_jump(logic_op_jump_pos2.back()->get()); patch_jump(logic_op_jump_pos2.back()->get());
logic_op_jump_pos1.pop_back(); logic_op_jump_pos1.pop_back();
logic_op_jump_pos2.pop_back(); logic_op_jump_pos2.pop_back();
append(GDScriptFunction::OPCODE_ASSIGN_FALSE, 0); append(GDScriptFunction::OPCODE_ASSIGN_FALSE, 1);
append(p_target); append(p_target);
} }
@ -453,7 +453,7 @@ void GDScriptByteCodeGenerator::write_end_or(const Address &p_target) {
// Jump away from the success condition. // Jump away from the success condition.
append(GDScriptFunction::OPCODE_JUMP, 0); append(GDScriptFunction::OPCODE_JUMP, 0);
append(opcodes.size() + 3); append(opcodes.size() + 3);
// Here it means one of operands is false. // Here it means one of operands is true.
patch_jump(logic_op_jump_pos1.back()->get()); patch_jump(logic_op_jump_pos1.back()->get());
patch_jump(logic_op_jump_pos2.back()->get()); patch_jump(logic_op_jump_pos2.back()->get());
logic_op_jump_pos1.pop_back(); logic_op_jump_pos1.pop_back();