mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
Merge pull request #1137 from EQEmu/bug_fix/rest_timer
Save the rest_timer sooner to prevent issues
This commit is contained in:
commit
31019b8832
@ -4725,6 +4725,12 @@ void Client::IncrementAggroCount(bool raid_target)
|
||||
|
||||
uint32 newtimer = raid_target ? RuleI(Character, RestRegenRaidTimeToActivate) : RuleI(Character, RestRegenTimeToActivate);
|
||||
|
||||
// When our aggro count is 1 here, we are exiting rest state. We need to pause our current timer, if we have time remaining
|
||||
// We should not actually have to do anything to the Timer object since the AggroCount counter blocks it from being checked
|
||||
// and will have it's timer changed when we exit combat so let's not do any extra work
|
||||
if (AggroCount == 1 && rest_timer.GetRemainingTime()) // the Client::rest_timer is never disabled, so don't need to check
|
||||
m_pp.RestTimer = std::max(1u, rest_timer.GetRemainingTime() / 1000); // I guess round up?
|
||||
|
||||
// save the new timer if it's higher
|
||||
m_pp.RestTimer = std::max(m_pp.RestTimer, newtimer);
|
||||
|
||||
@ -4734,10 +4740,6 @@ void Client::IncrementAggroCount(bool raid_target)
|
||||
if(AggroCount > 1)
|
||||
return;
|
||||
|
||||
// Pause the rest timer, it's possible the new timer is a non-raid timer we're currently ticking down on a raid timer
|
||||
if (AggroCount == 1)
|
||||
m_pp.RestTimer = std::max(m_pp.RestTimer, rest_timer.GetRemainingTime() / 1000);
|
||||
|
||||
if (ClientVersion() >= EQ::versions::ClientVersion::SoF) {
|
||||
auto outapp = new EQApplicationPacket(OP_RestState, 1);
|
||||
char *Buffer = (char *)outapp->pBuffer;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user