From d2553a138afcbda3ad24f7cbcc9e1202831bb049 Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 26 Jun 2010 13:41:36 +0200 Subject: [PATCH] =?UTF-8?q?Use=20valid=20co=C3=B6rdinates=20for=20Unit::Up?= =?UTF-8?q?dateUnderWaterState=20instead=20of=20raw=20co=C3=B6rdinates.=20?= =?UTF-8?q?Fixes=20another=20potential=20crash=20related=20to=20vmaps.=20U?= =?UTF-8?q?pdates=20issue=20#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(-) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 9dfb0ed3f5..5093ec518a 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();