Merge branch 'master' of git://github.com/TrinityCore/TrinityCore into AchievementFix
This commit is contained in:
@@ -12814,6 +12814,14 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
return;
|
||||
}
|
||||
|
||||
//! If trading
|
||||
if (TradeData* tradeData = GetTradeData())
|
||||
{
|
||||
//! If current item is in trade window (only possible with packet spoofing - silent return)
|
||||
if (tradeData->GetTradeSlotForItem(pSrcItem->GetGUID()) != TRADE_SLOT_INVALID)
|
||||
return;
|
||||
}
|
||||
|
||||
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count);
|
||||
Item* pNewItem = pSrcItem->CloneItem(count, this);
|
||||
if (!pNewItem)
|
||||
@@ -12883,17 +12891,6 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
|
||||
EquipItem(dest, pNewItem, true);
|
||||
AutoUnequipOffhandIfNeed();
|
||||
}
|
||||
|
||||
//! Make sure that code below only is executed when trading
|
||||
if (!GetTradeData())
|
||||
return;
|
||||
|
||||
//! Update item count in trade window, prevent spoofing
|
||||
//! Since pSrcItem has its count updated (see above), Item::GetCount() will return the new count
|
||||
//! in the underlying packet builder function
|
||||
TradeSlots const slot = GetTradeData()->GetTradeSlotForItem(pSrcItem->GetGUID());
|
||||
if (slot != TRADE_SLOT_INVALID)
|
||||
GetTradeData()->SetItem(slot, pSrcItem);
|
||||
}
|
||||
|
||||
void Player::SwapItem(uint16 src, uint16 dst)
|
||||
|
||||
@@ -203,7 +203,9 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
|
||||
// skip non-existed member
|
||||
if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name))
|
||||
{
|
||||
CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow);
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
|
||||
stmt->setUInt32(0, guidLow);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed)
|
||||
init.SetVelocity(speed);
|
||||
init.SetAnimation(Movement::ToGround);
|
||||
init.Launch();
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed)
|
||||
@@ -322,7 +322,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed)
|
||||
init.SetVelocity(speed);
|
||||
init.SetAnimation(Movement::ToFly);
|
||||
init.Launch();
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
|
||||
@@ -365,7 +365,10 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
||||
init.SetParabolic(max_height,0);
|
||||
init.SetVelocity(speedXY);
|
||||
init.Launch();
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
if (i_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
else
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveFall(uint32 id/*=0*/)
|
||||
|
||||
@@ -211,6 +211,19 @@ void ChaseMovementGenerator<T>::Reset(T &owner)
|
||||
Initialize(owner);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void ChaseMovementGenerator<T>::MovementInform(T & /*unit*/)
|
||||
{
|
||||
}
|
||||
|
||||
template<>
|
||||
void ChaseMovementGenerator<Creature>::MovementInform(Creature &unit)
|
||||
{
|
||||
// Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
|
||||
if (unit.AI())
|
||||
unit.AI()->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
|
||||
}
|
||||
|
||||
//-----------------------------------------------//
|
||||
template<>
|
||||
bool FollowMovementGenerator<Creature>::EnableWalking() const
|
||||
@@ -300,6 +313,7 @@ template void ChaseMovementGenerator<Player>::Finalize(Player &);
|
||||
template void ChaseMovementGenerator<Creature>::Finalize(Creature &);
|
||||
template void ChaseMovementGenerator<Player>::Reset(Player &);
|
||||
template void ChaseMovementGenerator<Creature>::Reset(Creature &);
|
||||
template void ChaseMovementGenerator<Player>::MovementInform(Player &unit);
|
||||
|
||||
template void FollowMovementGenerator<Player>::Finalize(Player &);
|
||||
template void FollowMovementGenerator<Creature>::Finalize(Creature &);
|
||||
|
||||
@@ -76,7 +76,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
|
||||
void Initialize(T &);
|
||||
void Finalize(T &);
|
||||
void Reset(T &);
|
||||
void MovementInform(T &){}
|
||||
void MovementInform(T &);
|
||||
|
||||
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_CHASE_MOVE); }
|
||||
|
||||
@@ -84,6 +84,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
|
||||
|
||||
// Inform script
|
||||
MovementInform(creature);
|
||||
creature.UpdateWaypointID(i_currentNode);
|
||||
Stop(i_path->at(i_currentNode)->delay);
|
||||
}
|
||||
|
||||
@@ -94,13 +95,11 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
|
||||
if (Stopped())
|
||||
return true;
|
||||
|
||||
const WaypointData *node = i_path->at(i_currentNode);
|
||||
|
||||
if (m_isArrivalDone)
|
||||
{
|
||||
if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint
|
||||
{
|
||||
creature.SetHomePosition(node->x, node->y, node->z, creature.GetOrientation());
|
||||
creature.SetHomePosition(i_path->at(i_currentNode)->x, i_path->at(i_currentNode)->y, i_path->at(i_currentNode)->z, creature.GetOrientation());
|
||||
creature.GetMotionMaster()->Initialize();
|
||||
return false;
|
||||
}
|
||||
@@ -108,6 +107,8 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
|
||||
i_currentNode = (i_currentNode+1) % i_path->size();
|
||||
}
|
||||
|
||||
const WaypointData *node = i_path->at(i_currentNode);
|
||||
|
||||
m_isArrivalDone = false;
|
||||
|
||||
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
|
||||
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
{
|
||||
uint32 tguid = chr->GetTransport()->AddNPCPassenger(0, id, chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
if (tguid > 0)
|
||||
WorldDatabase.PQuery("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
WorldDatabase.PExecute("INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (%u, %u, %f, %f, %f, %f, %u)", tguid, id, chr->GetTransport()->GetEntry(), chr->GetTransOffsetX(), chr->GetTransOffsetY(), chr->GetTransOffsetZ(), chr->GetTransOffsetO());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ public:
|
||||
|
||||
if (target->GetTransport())
|
||||
if (target->GetGUIDTransport())
|
||||
WorldDatabase.PQuery("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
|
||||
WorldDatabase.PExecute("UPDATE creature_transport SET emote=%u WHERE transport_entry=%u AND guid=%u", emote, target->GetTransport()->GetEntry(), target->GetGUIDTransport());
|
||||
|
||||
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user