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:
Machiavelli
2010-06-26 13:41:36 +02:00
parent 26da69a544
commit d2553a138a
+3 -1
View File
@@ -6207,7 +6207,9 @@ bool Player::SetPosition(float x, float y, float z, float orientation, bool tele
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
// 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))
GetSession()->SendCancelTrade();