mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
Merge pull request #16091 from luiscuenca/reactionsRefCountFix
BUGZ-1265: Don't allow reactions refcount go bellow 0
This commit is contained in:
commit
af46a180ab
1 changed files with 7 additions and 2 deletions
|
@ -5863,8 +5863,13 @@ 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]--;
|
||||
return true;
|
||||
if (_reactionEnabledRefCounts[reactionIndex] > 0) {
|
||||
_reactionEnabledRefCounts[reactionIndex]--;
|
||||
return true;
|
||||
} else {
|
||||
_reactionEnabledRefCounts[reactionIndex] = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue