Stop running rumble effects if duration is 0

This commit is contained in:
Inori 2019-09-20 17:58:23 -04:00
parent 70e1aba3cf
commit 7cb30be8e6
3 changed files with 8 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,10 +1,6 @@
embedded_assets = []
if get_option('mk') == true
embedded_assets += 'icon_mk.png'
else
embedded_assets += 'icon.png'
endif
embedded_assets = [
'icon.png'
]
if get_option('cjk_fallback_font') == true
embedded_assets += 'wqymicrohei.ttf'

View file

@ -503,7 +503,11 @@ void EventThread::process(RGSSThreadData &rtData)
hapticEffect.constant.fade_level = 0;
hapticEffectId = SDL_HapticNewEffect(hapt, &hapticEffect);
}
if (hapticEffect.constant.length == 0 && SDL_HapticGetEffectStatus(hapt, hapticEffectId) > 0)
{
SDL_HapticStopEffect(hapt, hapticEffectId);
break;
}
SDL_HapticUpdateEffect(hapt, hapticEffectId, &hapticEffect);
SDL_HapticRunEffect(hapt, hapticEffectId, 1);