From c2432d23e8dbc83c8a238c41c18fe8c8156f3e69 Mon Sep 17 00:00:00 2001 From: k-bar <92504151+k-bar@users.noreply.github.com> Date: Tue, 31 May 2022 00:40:42 +0200 Subject: [PATCH] Berserk light fix --- Source/diablo.cpp | 6 ++++++ Source/loadsave.cpp | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 1b945554c..262c1bec3 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1228,6 +1228,12 @@ void UpdateMonsterLights() { for (int i = 0; i < ActiveMonsterCount; i++) { auto &monster = Monsters[ActiveMonsters[i]]; + + if ((monster._mFlags & MFLAG_BERSERK) != 0) { + int lightRadius = leveltype == DTYPE_NEST ? 9 : 3; + monster.mlid = AddLight(monster.position.tile, lightRadius); + } + if (monster.mlid != NO_LIGHT) { if (monster.mlid == MyPlayer->_plid) { // Fix old saves where some monsters had 0 instead of NO_LIGHT monster.mlid = NO_LIGHT; diff --git a/Source/loadsave.cpp b/Source/loadsave.cpp index aae70bfc9..d7255d312 100644 --- a/Source/loadsave.cpp +++ b/Source/loadsave.cpp @@ -647,11 +647,6 @@ void LoadMonster(LoadHelper *file, Monster &monster) if (monster.mlid == 0) monster.mlid = NO_LIGHT; // Correct incorect values in old saves - if ((monster._mFlags & MFLAG_BERSERK) != 0) { - int lightRadius = leveltype == DTYPE_NEST ? 9 : 3; - monster.mlid = AddLight(monster.position.tile, lightRadius); - } - // Omit pointer mName; // Omit pointer MType; // Omit pointer MData;