Use valid coördinates for Unit::UpdateUnderWaterState instead of raw coördinates. Fixes another potential crash related to vmaps.
Updates issue #2748 --HG-- branch : trunk
This commit is contained in:
@@ -6207,7 +6207,9 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
|
|||||||
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
|
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
|
||||||
|
|
||||||
// code block for underwater state update
|
// code block for underwater state update
|
||||||
UpdateUnderwaterState(GetMap(), x, y, z);
|
// Unit::SetPosition() checks for validity and updates our coordinates
|
||||||
|
// so we re-fetch them instead of using "raw" coordinates from function params
|
||||||
|
UpdateUnderwaterState(GetMap(), GetPositionX(), GetPositionY(), GetPositionZ());
|
||||||
|
|
||||||
if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE))
|
if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE))
|
||||||
GetSession()->SendCancelTrade();
|
GetSession()->SendCancelTrade();
|
||||||
|
|||||||
Reference in New Issue
Block a user