overlaytopleft/games-fps/gzdoom/files/0048-Fix-value-of-X-Y-when-Y-is-an-int-constant.patch

34 lines
933 B
Diff

From 2990caaa937b96c70124258ed48353587dbcdd4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= <ricolvs123@gmail.com>
Date: Sat, 11 Feb 2023 12:51:25 -0300
Subject: [PATCH 48/51] Fix value of `X = Y` when Y is an int constant
---
src/common/scripting/backend/codegen.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/common/scripting/backend/codegen.cpp b/src/common/scripting/backend/codegen.cpp
index 6cf593fa2..7be3c67c1 100644
--- a/src/common/scripting/backend/codegen.cpp
+++ b/src/common/scripting/backend/codegen.cpp
@@ -2571,7 +2571,15 @@ ExpEmit FxAssign::Emit(VMFunctionBuilder *build)
}
pointer.Free(build);
- return result;
+
+ if(intconst)
+ { //fix int constant return for assignment
+ return Right->Emit(build);
+ }
+ else
+ {
+ return result;
+ }
}
//==========================================================================
--
2.39.3