fix IsImmune function

This commit is contained in:
guiyomu-dev
2026-01-06 00:29:32 +01:00
parent 2b87b5f555
commit 691d8f7e84

View File

@@ -99,8 +99,9 @@ func (m Monsters) FindByID(id UnitID) (Monster, bool) {
func (m Monster) IsImmune(resist stat.Resist) bool {
for st, value := range m.Stats {
// Only consider immunity threshold (>= 100).
if value < 100 {
// We only want max resistance
// Need to cast to int32 because type is uint32 and negative values are possible (e.g. -50 for Andariel)
if int32(value) < 100 {
continue
}
if resist == stat.ColdImmune && st == stat.ColdResist {