From d2553a138afcbda3ad24f7cbcc9e1202831bb049 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 26 Jun 2010 13:41:36 +0200 Subject: Use valid coördinates for Unit::UpdateUnderWaterState instead of raw coördinates. Fixes another potential crash related to vmaps. Updates issue #2748 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : trunk --- src/server/game/Entities/Player/Player.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9dfb0ed3f57..5093ec518a6 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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(); -- cgit v1.2.3