[12705] Fix SMSG_BINDPOINTUPDATE and SMSG_PLAYERBOUND sent data

also improve DebugLog output (original author @Schmoozerd)
This commit is contained in:
sanctum32 2013-10-21 10:20:02 +03:00 committed by Antz
parent a5a5009d44
commit ae593e19f0
2 changed files with 7 additions and 9 deletions

View file

@ -10350,7 +10350,7 @@ void Spell::EffectBind(SpellEffectEntry const* effect)
Player* player = (Player*)unitTarget; Player* player = (Player*)unitTarget;
uint32 area_id; uint32 area_id = m_spellInfo->EffectMiscValue[eff_idx];
WorldLocation loc; WorldLocation loc;
if (effect->EffectImplicitTargetA == TARGET_TABLE_X_Y_Z_COORDINATES || if (effect->EffectImplicitTargetA == TARGET_TABLE_X_Y_Z_COORDINATES ||
effect->EffectImplicitTargetB == 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_y = st->target_Y;
loc.coord_z = st->target_Z; loc.coord_z = st->target_Z;
loc.orientation = st->target_Orientation; 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 else
{ {
player->GetPosition(loc); player->GetPosition(loc);
area_id = player->GetAreaId(); if (!area_id)
area_id = player->GetAreaId();
} }
player->SetHomebindToLocation(loc, area_id); player->SetHomebindToLocation(loc, area_id);
@ -10386,11 +10388,7 @@ void Spell::EffectBind(SpellEffectEntry const* effect)
data << uint32(area_id); data << uint32(area_id);
player->SendDirectMessage(&data); player->SendDirectMessage(&data);
DEBUG_LOG("New Home Position X is %f", loc.coord_x); 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);
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);
// zone update // zone update
data.Initialize(SMSG_PLAYERBOUND, 8 + 4); data.Initialize(SMSG_PLAYERBOUND, 8 + 4);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "12704" #define REVISION_NR "12705"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__