summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-03-10 20:05:52 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-03-10 21:17:59 -0400
commit6c4ce7ec80831ad8f0eba6d5a63ef84290c75efb (patch)
treed0fcde87aa7b9af93ad587fb607d887042c5cce6
parent7a8b7bfc95bdba9596a7d867221b521d90e450e0 (diff)
Fix fakematch reuse of var in getLayerNo
Turns out that a double ternary has different codegen than if+else+ternary
-rw-r--r--src/d/d_com_inf_game.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/d/d_com_inf_game.cpp b/src/d/d_com_inf_game.cpp
index 4cdae031..dc2459f7 100644
--- a/src/d/d_com_inf_game.cpp
+++ b/src/d/d_com_inf_game.cpp
@@ -185,12 +185,9 @@ void dComIfG_play_c::itemInit() {
int dComIfG_play_c::getLayerNo(int i_roomNo) {
int stageLayer = dComIfGp_getStartStageLayer();
if (stageLayer < 0) {
- int layer = dKy_getdaytime_hour();
- if (dKy_checkEventNightStop()) {
- layer = 1;
- } else {
- layer = (layer >= 6 && layer < 18) ? 0 : 1;
- }
+ int hour = dKy_getdaytime_hour();
+ int layer = dKy_checkEventNightStop() ? 1 :
+ hour >= 6 && hour < 18 ? 0 : 1;
if (strcmp(dComIfGp_getStartStageName(), "sea") == 0) {
if (i_roomNo == dIsleRoom_OutsetIsland_e) {