From a5ea7635678260427f8f13f209defabe953ba1f3 Mon Sep 17 00:00:00 2001 From: qndel Date: Thu, 16 Sep 2021 21:44:37 +0200 Subject: [PATCH] fix saves bricked by spawn command --- Source/monster.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/monster.cpp b/Source/monster.cpp index 33f57ce34..5c6e5f2ac 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4524,6 +4524,13 @@ bool LineClear(const std::function &clear, Point startPoint, Point void SyncMonsterAnim(Monster &monster) { monster.MType = &LevelMonsterTypes[monster._mMTidx]; +#ifdef _DEBUG + // fix for saves with debug monsters having type originally not on the level + if (LevelMonsterTypes[monster._mMTidx].MData == nullptr) { + InitMonsterGFX(monster._mMTidx); + LevelMonsterTypes[monster._mMTidx].mdeadval = 1; + } +#endif monster.MData = LevelMonsterTypes[monster._mMTidx].MData; if (monster._uniqtype != 0) monster.mName = _(UniqueMonstersData[monster._uniqtype - 1].mName);