Browse Source

Berserk light fix

pull/4827/head
k-bar 4 years ago committed by Anders Jenbo
parent
commit
c2432d23e8
  1. 6
      Source/diablo.cpp
  2. 5
      Source/loadsave.cpp

6
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;

5
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;

Loading…
Cancel
Save