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

Cleaned up Entity#tryAsPlayer

This commit is contained in:
Auxilor
2021-12-06 16:16:43 +00:00
parent 126a26ff98
commit eb031700c8

View File

@@ -171,10 +171,7 @@ fun Player.setStatLevel(stat: Stat, level: Int) {
fun Entity.tryAsPlayer(): Player? {
return when (this) {
is Projectile -> {
val shooter = this.shooter
if (shooter is Player) shooter else null
}
is Projectile -> this.shooter as? Player
is Player -> this
else -> null
}