fix(core): send override

Keep the original hasSound attribute when replacing the snap duration
This commit is contained in:
rhunk
2024-10-24 22:55:44 +02:00
parent 7458d57c27
commit aa47c7bc6a

View File

@@ -63,9 +63,17 @@ class SendOverride : Feature("Send Override") {
}
// set back the original snap duration
remove(2)
snapDocPlayback.getByteArray(2)?.let {
val originalHasSound = firstOrNull(2)?.toReader()?.getVarInt(5)
remove(2)
addBuffer(2, it)
originalHasSound?.let { hasSound ->
edit(2) {
remove(5)
addVarInt(5, hasSound)
}
}
}
}