From 1a36f1c03978cfab168bb8af71365de5d03ef9e4 Mon Sep 17 00:00:00 2001 From: H0zen Date: Fri, 22 Jan 2016 16:38:10 +0200 Subject: [PATCH] Fix Unit::SetConfused to work on players. - Also removed a false positive from being output as error in MovementHandler.cpp --- src/game/Object/Unit.cpp | 11 +++++------ src/game/WorldHandlers/MovementHandler.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/game/Object/Unit.cpp b/src/game/Object/Unit.cpp index 77491d91..70c08ea2 100644 --- a/src/game/Object/Unit.cpp +++ b/src/game/Object/Unit.cpp @@ -8553,7 +8553,7 @@ void Unit::SetFeared(bool apply, ObjectGuid casterGuid, uint32 spellID, uint32 t } if (GetTypeId() == TYPEID_PLAYER) - { ((Player*)this)->SetClientControl(this, apply ? 0 : 1); } + { ((Player*)this)->SetClientControl(this, !apply); } } void Unit::SetConfused(bool apply, ObjectGuid casterGuid, uint32 spellID) @@ -8566,10 +8566,9 @@ void Unit::SetConfused(bool apply, ObjectGuid casterGuid, uint32 spellID) CastStop(GetObjectGuid() == casterGuid ? spellID : 0); if (GetTypeId() == TYPEID_UNIT) - { - SetTargetGuid(ObjectGuid()); - GetMotionMaster()->MoveConfused(); - } + SetTargetGuid(ObjectGuid()); + + GetMotionMaster()->MoveConfused(); } else { @@ -8593,7 +8592,7 @@ void Unit::SetConfused(bool apply, ObjectGuid casterGuid, uint32 spellID) } if (GetTypeId() == TYPEID_PLAYER) - { ((Player*)this)->SetClientControl(this, apply ? 0 : 1); } + { ((Player*)this)->SetClientControl(this, !apply); } } void Unit::SetFeignDeath(bool apply, ObjectGuid casterGuid /*= ObjectGuid()*/) diff --git a/src/game/WorldHandlers/MovementHandler.cpp b/src/game/WorldHandlers/MovementHandler.cpp index 61eb3502..68ce9863 100644 --- a/src/game/WorldHandlers/MovementHandler.cpp +++ b/src/game/WorldHandlers/MovementHandler.cpp @@ -385,10 +385,11 @@ void WorldSession::HandleMoveNotActiveMoverOpcode(WorldPacket& recv_data) if (_player->GetMover()->GetObjectGuid() == old_mover_guid) { - sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is %s and should be %s instead of %s", - _player->GetMover()->GetGuidStr().c_str(), - _player->GetGuidStr().c_str(), - old_mover_guid.GetString().c_str()); + if (_player->GetObjectGuid() != old_mover_guid ) + sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is %s and should be %s instead of %s", + _player->GetMover()->GetGuidStr().c_str(), + _player->GetGuidStr().c_str(), + old_mover_guid.GetString().c_str()); recv_data.rpos(recv_data.wpos()); // prevent warnings spam return; }