From eb43bfb9a3e54a203242d0a58f780146253b2333 Mon Sep 17 00:00:00 2001 From: qndel Date: Tue, 27 Oct 2020 02:17:58 +0100 Subject: [PATCH] Sync monster light posistion when loading a level --- Source/diablo.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 651ce77d3..bc4d53c0e 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -1554,6 +1554,19 @@ void CreateLevel(int lvldir) } } +static void UpdateMonsterLights() +{ + for (int i = 0; i < nummonsters; i++) { + MonsterStruct *mon = &monster[monstactive[i]]; + if (mon->mlid != NO_LIGHT) { + LightListStruct *lid = &LightList[mon->mlid]; + if (mon->_mx != lid->_lx || mon->_my != lid->_ly){ + ChangeLightXY(mon->mlid, mon->_mx, mon->_my); + } + } + } +} + void LoadGameLevel(BOOL firstflag, int lvldir) { int i, j; @@ -1764,6 +1777,7 @@ void LoadGameLevel(BOOL firstflag, int lvldir) InitControlPan(); } IncProgress(); + UpdateMonsterLights(); if (leveltype != DTYPE_TOWN) { ProcessLightList(); ProcessVisionList();