From a04cc4fd40eefb4b6fd9e8d643d95daae6d1c461 Mon Sep 17 00:00:00 2001 From: pierow Date: Wed, 4 Oct 2023 18:10:53 -0400 Subject: [PATCH] add check for recent saying counter not resetting --- main/source/mod/AvHPlayer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main/source/mod/AvHPlayer.cpp b/main/source/mod/AvHPlayer.cpp index 36002576..0909b213 100644 --- a/main/source/mod/AvHPlayer.cpp +++ b/main/source/mod/AvHPlayer.cpp @@ -3887,13 +3887,21 @@ void AvHPlayer::ValidateClientMoveEvents() case ORDER_ACK: // If cheats if(GetGameRules()->GetCheatsEnabled() - // OR It's less than the min saying interval, with less than 2 recent sayings, and they're not trying to say the same thing twice + // OR It's been longer than the min saying interval, with less than 2 recent sayings, and they're not trying to say the same thing twice || (gpGlobals->time > (this->mTimeOfLastSaying + kMinSayingInterval) && this->mRecentSayingCounter < 2 && !(gpGlobals->time < (this->mTimeOfLastSaying + kRepeatSayingInterval) && theMessageID == this->GetLastSaying()))) { theIsValid = true; this->mRecentSayingCounter += 1; } + // Check if repeat saying counter isn't getting decremented for some reason, like plugins intercepting the impulse. + else if (gpGlobals->time > (this->mTimeOfLastSaying + kSpeakingTime + 0.05f)) + { + ALERT(at_console, "Saying counter fallback triggered: %d\n", this->mRecentSayingCounter); + theIsValid = true; + this->mRecentSayingCounter = 1; + + } else { //2023 - Why???