Skip to content

Commit f3b0268

Browse files
committed
feat: play player weapon sounds - silenced logic
1 parent 72699fa commit f3b0268

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cake/core/src/main/java/org/demoth/cake/stages/Game3dScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,11 @@ class Game3dScreen : KtxScreen, InputProcessor, ServerMessageProcessor {
564564
override fun processWeaponSoundMessage(msg: WeaponSoundMessage) {
565565
// weapon type is stored in last 7 bits of the msg.type
566566
val weaponType = msg.type and 0x7F
567+
// the silenced flag is stored in the first bit
568+
val silenced = (msg.type and 0x80) != 0
567569
val sound = weaponSounds[weaponType]
568570
if (sound != null) {
569-
sound.play()
571+
sound.play(if (silenced) 0.2f else 1f)
570572
} else {
571573
// todo: warning!
572574
}

0 commit comments

Comments
 (0)