From c37dcc6eb4151137c2f2fead6c9f3b7eaf403552 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 20 Apr 2020 13:32:02 +0300 Subject: [PATCH] - added validation of game skill when changing a level --- src/g_level.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index bd3d86855..875ade355 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -634,8 +634,7 @@ void FLevelLocals::ChangeLevel(const char *levelname, int position, int inflags, nextlevel = levelname; } - if (nextSkill != -1) - NextSkill = nextSkill; + NextSkill = (unsigned)nextSkill < AllSkills.Size() ? nextSkill : -1; if (inflags & CHANGELEVEL_NOINTERMISSION) {