client: remember the last haptics amplitude to not skip stop commands

The self-assignment in the haptics handler left the stored amplitude
at its initial value of 0, so the "skip redundant calls" guard was
true for every amplitude-0 packet and haptic_stop() was never called.
Rumbles could not be cancelled early and kept playing for their whole
duration.

Store the newly applied amplitude so the guard only skips stops when
nothing was playing.
This commit is contained in:
dime-online
2026-09-27 19:14:07 +02:00
committed by xytovl
parent ee0d667105
commit 8e3fd29c94
+1 -1
View File
@@ -79,7 +79,7 @@ void scenes::stream::operator()(to_headset::haptics && haptics)
{
XrAction action = it->second.action;
float old = it->second.amplitude;
it->second.amplitude = old;
it->second.amplitude = haptics.amplitude;
// Some runtimes may be slow to process actions
// Skip it if not necessary
if (old == 0 and haptics.amplitude == 0)