mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 18:13:48 +00:00
fix(Core/Misc): fix some exploits (#2630)
This commit is contained in:
@@ -1012,7 +1012,7 @@ void WorldObject::setActive(bool on)
|
||||
|
||||
m_isActive = on;
|
||||
|
||||
if (!IsInWorld())
|
||||
if (on && !IsInWorld())
|
||||
return;
|
||||
|
||||
Map* map = FindMap();
|
||||
|
||||
@@ -16760,6 +16760,9 @@ void Unit::SetStunned(bool apply)
|
||||
{
|
||||
if (apply)
|
||||
{
|
||||
if (m_rootTimes > 0) // blizzard internal check?
|
||||
m_rootTimes++;
|
||||
|
||||
SetTarget(0);
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
|
||||
@@ -16769,10 +16772,19 @@ void Unit::SetStunned(bool apply)
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_MASK_MOVING);
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
|
||||
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8);
|
||||
data.append(GetPackGUID());
|
||||
data << uint32(0);
|
||||
SendMessageToSet(&data, true);
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10);
|
||||
data.append(GetPackGUID());
|
||||
data << m_rootTimes;
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8);
|
||||
data.append(GetPackGUID());
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
// xinef: inform client about our current orientation
|
||||
SendMovementFlagUpdate();
|
||||
@@ -16807,10 +16819,19 @@ void Unit::SetStunned(bool apply)
|
||||
|
||||
if (!HasUnitState(UNIT_STATE_ROOT)) // prevent moving if it also has root effect
|
||||
{
|
||||
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4);
|
||||
data.append(GetPackGUID());
|
||||
data << uint32(0);
|
||||
SendMessageToSet(&data, true);
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10);
|
||||
data.append(GetPackGUID());
|
||||
data << ++m_rootTimes;
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8);
|
||||
data.append(GetPackGUID());
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT);
|
||||
}
|
||||
|
||||
@@ -72,7 +72,22 @@ public:
|
||||
if (target->GetGuildId())
|
||||
{
|
||||
handler->SendSysMessage(LANG_PLAYER_IN_GUILD);
|
||||
return true;
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sGuildMgr->GetGuildByName(guildName))
|
||||
{
|
||||
handler->SendSysMessage(LANG_GUILD_RENAME_ALREADY_EXISTS);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (sObjectMgr->IsReservedName(guildName) || !sObjectMgr->IsValidCharterName(guildName))
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Guild* guild = new Guild;
|
||||
|
||||
Reference in New Issue
Block a user