Skip to content

Commit

Permalink
Avoid sending some unnecessary group updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
hunuza committed Nov 21, 2008
1 parent 76f4a9d commit 42d0d95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/game/Player.cpp
Expand Up @@ -5150,17 +5150,17 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
x = GetPositionX();
y = GetPositionY();
z = GetPositionZ();

// group update
if(GetGroup() && (old_x != x || old_y != y))
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
}

// code block for underwater state update
UpdateUnderwaterState(m, x, y, z);

CheckExploreSystem();

// group update
if(GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/game/Unit.cpp
Expand Up @@ -9673,6 +9673,9 @@ void Unit::SetMaxHealth(uint32 val)

void Unit::SetPower(Powers power, uint32 val)
{
if(GetPower(power) == val)
return;

uint32 maxPower = GetMaxPower(power);
if(maxPower < val)
val = maxPower;
Expand Down

0 comments on commit 42d0d95

Please sign in to comment.