Cut down on some HP update spam

This increases the timer that mobs will send out updates
(It could probably be increased more)
This will also reset the timer every time SendHPUpdate is called
to prevent sending like 3+ completely useless updates at once
Also skip sending the update to the client if we're sending an
OP_Damage with the damage since the client will apply this number
This commit is contained in:
Michael Cook (mackal)
2015-06-06 17:46:53 -04:00
parent 03bc245318
commit 42a5ddcf77
9 changed files with 35 additions and 28 deletions
+3 -1
View File
@@ -129,7 +129,9 @@ bool Client::Process() {
if(IsTracking() && (GetClientVersion() >= ClientVersion::SoD) && TrackingTimer.Check())
DoTracking();
if(hpupdate_timer.Check())
// SendHPUpdate calls hpupdate_timer.Start so it can delay this timer, so lets not reset with the check
// since the function will anyways
if(hpupdate_timer.Check(false))
SendHPUpdate();
if(mana_timer.Check())