mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 16:36:55 +02:00
Don't allow reactions ref count got bellow 0
This commit is contained in:
parent
4d71891763
commit
da9163616a
1 changed files with 5 additions and 1 deletions
|
@ -5863,7 +5863,11 @@ bool MyAvatar::endReaction(QString reactionName) {
|
|||
int reactionIndex = beginEndReactionNameToIndex(reactionName);
|
||||
if (reactionIndex >= 0 && reactionIndex < (int)NUM_AVATAR_BEGIN_END_REACTIONS) {
|
||||
std::lock_guard<std::mutex> guard(_reactionLock);
|
||||
_reactionEnabledRefCounts[reactionIndex]--;
|
||||
if (_reactionEnabledRefCounts[reactionIndex] > 0) {
|
||||
_reactionEnabledRefCounts[reactionIndex]--;
|
||||
} else {
|
||||
_reactionEnabledRefCounts[reactionIndex] = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue