Create missing small monster entries in draw function

This commit is contained in:
GreenComfyTea
2023-08-06 12:13:48 +03:00
parent 6f40a1dfd3
commit 681b865f03

View File

@@ -69,16 +69,20 @@ function this.draw()
goto continue; goto continue;
end end
local monster = small_monster.list[enemy]; local monster = small_monster.get_monster(enemy);
if monster == nil then if monster == nil then
error_handler.report("small_monster_UI.draw", "Missing Entry: monster No. " .. tostring(i)); error_handler.report("small_monster_UI.draw", "Failed to Create Small Monster Entry No. " .. tostring(i));
goto continue; goto continue;
end end
-- causes VMContext corruption and call failures
--for enemy, monster in pairs(small_monster.list) do
if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then if monster.dead_or_captured and cached_config.settings.hide_dead_or_captured then
goto continue; goto continue;
end; end;
small_monster.update_position(enemy, monster);
table.insert(displayed_monsters, monster); table.insert(displayed_monsters, monster);
::continue:: ::continue::
end end