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