mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 03:31:08 +00:00
Fix for player hp updates not matching between client and server
This commit is contained in:
+14
-1
@@ -186,6 +186,7 @@ Mob::Mob(
|
||||
|
||||
last_hp_percent = 0;
|
||||
last_hp = 0;
|
||||
last_max_hp = 0;
|
||||
|
||||
current_speed = base_runspeed;
|
||||
|
||||
@@ -1334,6 +1335,16 @@ void Mob::SendHPUpdate(bool skip_self /*= false*/, bool force_update_all /*= fal
|
||||
* If our HP is different from last HP update call - let's update selves
|
||||
*/
|
||||
if (IsClient()) {
|
||||
|
||||
// delay to allow the client to catch up on buff states
|
||||
if (max_hp != last_max_hp) {
|
||||
|
||||
last_max_hp = max_hp;
|
||||
CastToClient()->hp_self_update_throttle_timer.Trigger();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_hp != last_hp || force_update_all) {
|
||||
|
||||
/**
|
||||
@@ -1341,10 +1352,12 @@ void Mob::SendHPUpdate(bool skip_self /*= false*/, bool force_update_all /*= fal
|
||||
*/
|
||||
if (this->CastToClient()->hp_self_update_throttle_timer.Check() || force_update_all) {
|
||||
Log(Logs::General, Logs::HPUpdate,
|
||||
"Mob::SendHPUpdate :: Update HP of self (%s) HP: %i last: %i skip_self: %s",
|
||||
"Mob::SendHPUpdate :: Update HP of self (%s) HP: %i/%i last: %i/%i skip_self: %s",
|
||||
this->GetCleanName(),
|
||||
current_hp,
|
||||
max_hp,
|
||||
last_hp,
|
||||
last_max_hp,
|
||||
(skip_self ? "true" : "false")
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user