From ae593e19f076600e7cf7a27df22921594d11a434 Mon Sep 17 00:00:00 2001 From: sanctum32 Date: Mon, 21 Oct 2013 10:20:02 +0300 Subject: [PATCH] [12705] Fix SMSG_BINDPOINTUPDATE and SMSG_PLAYERBOUND sent data also improve DebugLog output (original author @Schmoozerd) --- src/game/SpellEffects.cpp | 14 ++++++-------- src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6eebe53ca..4bd49f6c5 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -10350,7 +10350,7 @@ void Spell::EffectBind(SpellEffectEntry const* effect) Player* player = (Player*)unitTarget; - uint32 area_id; + uint32 area_id = m_spellInfo->EffectMiscValue[eff_idx]; WorldLocation loc; if (effect->EffectImplicitTargetA == TARGET_TABLE_X_Y_Z_COORDINATES || effect->EffectImplicitTargetB == TARGET_TABLE_X_Y_Z_COORDINATES) @@ -10367,12 +10367,14 @@ void Spell::EffectBind(SpellEffectEntry const* effect) loc.coord_y = st->target_Y; loc.coord_z = st->target_Z; loc.orientation = st->target_Orientation; - area_id = sTerrainMgr.GetAreaId(loc.mapid, loc.coord_x, loc.coord_y, loc.coord_z); + if (!area_id) + area_id = sTerrainMgr.GetAreaId(loc.mapid, loc.coord_x, loc.coord_y, loc.coord_z); } else { player->GetPosition(loc); - area_id = player->GetAreaId(); + if (!area_id) + area_id = player->GetAreaId(); } player->SetHomebindToLocation(loc, area_id); @@ -10386,11 +10388,7 @@ void Spell::EffectBind(SpellEffectEntry const* effect) data << uint32(area_id); player->SendDirectMessage(&data); - DEBUG_LOG("New Home Position X is %f", loc.coord_x); - DEBUG_LOG("New Home Position Y is %f", loc.coord_y); - DEBUG_LOG("New Home Position Z is %f", loc.coord_z); - DEBUG_LOG("New Home MapId is %u", loc.mapid); - DEBUG_LOG("New Home AreaId is %u", area_id); + DEBUG_LOG("New Home Position for %s: XYZ: %f %f %f on Map %u", player->GetGuidStr().c_str(), loc.coord_x, loc.coord_y, loc.coord_z, loc.mapid); // zone update data.Initialize(SMSG_PLAYERBOUND, 8 + 4); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 79dd33598..1793f01c7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12704" + #define REVISION_NR "12705" #endif // __REVISION_NR_H__