mirror of
https://github.com/ENSL/NS.git
synced 2024-11-13 00:24:38 +00:00
sayings can be used twice in succession
This commit is contained in:
parent
6598ac870a
commit
2ca087b76c
2 changed files with 13 additions and 4 deletions
|
@ -3434,6 +3434,7 @@ void AvHPlayer::Init()
|
||||||
this->mEnemySighted = false;
|
this->mEnemySighted = false;
|
||||||
this->mTriggerUncloak = false;
|
this->mTriggerUncloak = false;
|
||||||
this->mTimeOfLastSaying = 0;
|
this->mTimeOfLastSaying = 0;
|
||||||
|
this->mRecentSayingCounter = 0;
|
||||||
this->mLastSaying = MESSAGE_NULL;
|
this->mLastSaying = MESSAGE_NULL;
|
||||||
this->mTimeOfLastEnemySighting = 0;
|
this->mTimeOfLastEnemySighting = 0;
|
||||||
this->mClientInTopDownMode = false;
|
this->mClientInTopDownMode = false;
|
||||||
|
@ -3855,7 +3856,8 @@ void AvHPlayer::ValidateClientMoveEvents()
|
||||||
bool theIsValid = false;
|
bool theIsValid = false;
|
||||||
this->mCurrentCommand.impulse = MESSAGE_NULL;
|
this->mCurrentCommand.impulse = MESSAGE_NULL;
|
||||||
this->pev->impulse = MESSAGE_NULL;
|
this->pev->impulse = MESSAGE_NULL;
|
||||||
const float kMinSayingInterval = 3.0f;
|
const float kMinSayingInterval = 0.5f;
|
||||||
|
const float kRepeatSayingInterval = 3.0f;
|
||||||
|
|
||||||
// Process universally allowable impulses
|
// Process universally allowable impulses
|
||||||
switch(theMessageID)
|
switch(theMessageID)
|
||||||
|
@ -3883,13 +3885,18 @@ void AvHPlayer::ValidateClientMoveEvents()
|
||||||
// preventing spamming of request and ack
|
// preventing spamming of request and ack
|
||||||
case ORDER_REQUEST:
|
case ORDER_REQUEST:
|
||||||
case ORDER_ACK:
|
case ORDER_ACK:
|
||||||
// :
|
// If cheats
|
||||||
if(GetGameRules()->GetCheatsEnabled() || (gpGlobals->time > (this->mTimeOfLastSaying + kMinSayingInterval)))
|
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
|
||||||
|
|| (gpGlobals->time > (this->mTimeOfLastSaying + kMinSayingInterval) && this->mRecentSayingCounter < 2
|
||||||
|
&& !(gpGlobals->time < (this->mTimeOfLastSaying + kRepeatSayingInterval) && theMessageID == this->GetLastSaying())))
|
||||||
{
|
{
|
||||||
theIsValid = true;
|
theIsValid = true;
|
||||||
|
this->mRecentSayingCounter += 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//2023 - Why???
|
||||||
int a = 0;
|
int a = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -7156,6 +7163,7 @@ void AvHPlayer::InternalSpeakingThink()
|
||||||
this->mIsSpeaking = false;
|
this->mIsSpeaking = false;
|
||||||
this->mOrderAcknowledged = false;
|
this->mOrderAcknowledged = false;
|
||||||
this->mOrdersRequested = false;
|
this->mOrdersRequested = false;
|
||||||
|
this->mRecentSayingCounter = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -651,6 +651,7 @@ private:
|
||||||
|
|
||||||
float mTimeOfLastF4;
|
float mTimeOfLastF4;
|
||||||
float mTimeOfLastSaying;
|
float mTimeOfLastSaying;
|
||||||
|
int mRecentSayingCounter;
|
||||||
AvHMessageID mLastSaying;
|
AvHMessageID mLastSaying;
|
||||||
bool mIsSpeaking;
|
bool mIsSpeaking;
|
||||||
bool mOrdersRequested;
|
bool mOrdersRequested;
|
||||||
|
|
Loading…
Reference in a new issue