Skip to content

Commit

Permalink
fix(legacy): teams armor check causing classcastexception
Browse files Browse the repository at this point in the history
Closes: #4747 & #4750
  • Loading branch information
EclipsesDev committed Dec 3, 2024
1 parent 84774e4 commit eb7ffc3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,17 @@ object Teams : Module("Teams", Category.MISC, gameDetecting = false, hideModule
val entityArmor = entity.getCurrentArmor(i)

if (playerArmor != null && entityArmor != null) {
val playerArmorColor = (playerArmor.item as ItemArmor).getColor(playerArmor)
val entityArmorColor = (entityArmor.item as ItemArmor).getColor(entityArmor)
val playerItem = playerArmor.item
val entityItem = entityArmor.item

return entityArmorColor == playerArmorColor
if (playerItem is ItemArmor && entityItem is ItemArmor) {
val playerArmorColor = playerItem.getColor(playerArmor)
val entityArmorColor = entityItem.getColor(entityArmor)

if (entityArmorColor == playerArmorColor) {
return true
}
}
}
}
}
Expand Down

0 comments on commit eb7ffc3

Please sign in to comment.