From e7ba810af7ee40867caf241ad8d2f7e3c26096cd Mon Sep 17 00:00:00 2001 From: obligaron Date: Fri, 1 Dec 2023 22:09:14 +0100 Subject: [PATCH] Update existing monsters after loading monster gfx --- Source/monster.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/monster.cpp b/Source/monster.cpp index f8b1ca813..87f74d592 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -3500,6 +3500,15 @@ void InitAllMonsterGFX() InitMonsterGFX(firstMonster, std::move(spritesData)); } LogVerbose(" Total monster graphics: {:>4d} KiB {:>4d} KiB", totalUniqueBytes / 1024, totalBytes / 1024); + + if (totalUniqueBytes > 0) { + // we loaded new sprites, check if we need to update existing monsters + for (size_t i = 0; i < ActiveMonsterCount; i++) { + Monster &monster = Monsters[ActiveMonsters[i]]; + if (!monster.animInfo.sprites) + SyncMonsterAnim(monster); + } + } } void WeakenNaKrul()