Skip to content

Commit

Permalink
updated soundDefinitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jarryd229 committed May 8, 2024
1 parent d94041c commit 96597ae
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import world.gregs.voidps.world.interact.entity.sound.playSound
val styleDefinitions: WeaponStyleDefinitions by inject()
val weaponDefinitions: WeaponAnimationDefinitions by inject()
val animationDefinitions: AnimationDefinitions by inject()
val soundDefinitions: SoundDefinitions by inject()

characterCombatAttack { character ->
character.playSound(calculateHitSound(target), delay)
Expand Down Expand Up @@ -71,9 +72,9 @@ fun hitAnimation(npc: NPC): String {

fun calculateHitSound(target: Character): String {
if (target is NPC) {
var animation = "${target.id}_hit"
if (animationDefinitions.contains(animation)) {
return animation
var sound = "${target.id}_hit"

Check warning on line 75 in game/src/main/kotlin/world/gregs/voidps/world/interact/entity/player/combat/melee/Block.kts

View workflow job for this annotation

GitHub Actions / qodana

Local 'var' is never modified and can be declared as 'val'

Variable is never modified, so it can be declared using 'val'
if (soundDefinitions.contains(sound)) {
return sound
}
return "${target.race}_hit"
}
Expand Down

0 comments on commit 96597ae

Please sign in to comment.