9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-06 15:51:52 +00:00

Fixed stat modifiers... again

This commit is contained in:
Auxilor
2021-10-05 11:12:21 +01:00
parent d670f114cb
commit 382d361f2b

View File

@@ -127,7 +127,15 @@ fun OfflinePlayer.setEffectLevel(effect: Effect, level: Int) {
}
fun OfflinePlayer.getStatLevel(stat: Stat): Int {
return profile.readInt(stat.id)
var base = profile.readInt(stat.id)
if (this is Player) {
for (modifier in this.getStatModifiers()) {
if (modifier.stat == stat) {
base += modifier.amount
}
}
}
return base
}
fun Player.setStatLevel(stat: Stat, level: Int) {