mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Avoid sending some unnecessary group updates.
This commit is contained in:
parent
cd50762206
commit
809bd7392f
2 changed files with 7 additions and 4 deletions
|
|
@ -5150,6 +5150,10 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
|
||||||
x = GetPositionX();
|
x = GetPositionX();
|
||||||
y = GetPositionY();
|
y = GetPositionY();
|
||||||
z = GetPositionZ();
|
z = GetPositionZ();
|
||||||
|
|
||||||
|
// group update
|
||||||
|
if(GetGroup() && (old_x != x || old_y != y))
|
||||||
|
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
|
||||||
}
|
}
|
||||||
|
|
||||||
// code block for underwater state update
|
// code block for underwater state update
|
||||||
|
|
@ -5157,10 +5161,6 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
|
||||||
|
|
||||||
CheckExploreSystem();
|
CheckExploreSystem();
|
||||||
|
|
||||||
// group update
|
|
||||||
if(GetGroup())
|
|
||||||
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9673,6 +9673,9 @@ void Unit::SetMaxHealth(uint32 val)
|
||||||
|
|
||||||
void Unit::SetPower(Powers power, uint32 val)
|
void Unit::SetPower(Powers power, uint32 val)
|
||||||
{
|
{
|
||||||
|
if(GetPower(power) == val)
|
||||||
|
return;
|
||||||
|
|
||||||
uint32 maxPower = GetMaxPower(power);
|
uint32 maxPower = GetMaxPower(power);
|
||||||
if(maxPower < val)
|
if(maxPower < val)
|
||||||
val = maxPower;
|
val = maxPower;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue