Skip to content

Commit b205ee1

Browse files
committed
Fix off-by-one error with legacy stage checks
Fixes #293
1 parent a58d2c3 commit b205ee1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

RSDKv5/RSDK/Scene/Legacy/v3/ScriptLegacyv3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4349,7 +4349,7 @@ void RSDK::Legacy::v3::ProcessScript(int32 scriptCodeStart, int32 jumpTableStart
43494349
case VAR_STAGELISTPOS: {
43504350
SceneListInfo *list = &sceneInfo.listCategory[sceneInfo.activeCategory];
43514351

4352-
if (list->sceneOffsetStart + scriptEng.operands[i] < list->sceneOffsetEnd)
4352+
if (list->sceneOffsetStart + scriptEng.operands[i] <= list->sceneOffsetEnd)
43534353
sceneInfo.listPos = list->sceneOffsetStart + scriptEng.operands[i];
43544354
break;
43554355
}

RSDKv5/RSDK/Scene/Legacy/v4/ScriptLegacyv4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5852,7 +5852,7 @@ void RSDK::Legacy::v4::ProcessScript(int32 scriptCodeStart, int32 jumpTableStart
58525852
case VAR_STAGELISTPOS: {
58535853
SceneListInfo *list = &sceneInfo.listCategory[sceneInfo.activeCategory];
58545854

5855-
if (list->sceneOffsetStart + scriptEng.operands[i] < list->sceneOffsetEnd)
5855+
if (list->sceneOffsetStart + scriptEng.operands[i] <= list->sceneOffsetEnd)
58565856
sceneInfo.listPos = list->sceneOffsetStart + scriptEng.operands[i];
58575857
break;
58585858
}

0 commit comments

Comments
 (0)