Core/GameObject: Added additional checks for GAMEOBJECT_TYPE_NEW_FLAG and GAMEOBJECT_TYPE_NEW_FLAG_DROP for potential exploits / lag issues
Port From (https://github.com/TrinityCore/TrinityCore/commit/28c5d71b284a19657a602590cc6fcc2f1746b124)
This commit is contained in:
@@ -2364,6 +2364,13 @@ namespace Game.Entities
|
|||||||
if (!user.IsPlayer())
|
if (!user.IsPlayer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
GameObjectType.NewFlag newFlag = (GameObjectType.NewFlag)m_goTypeImpl;
|
||||||
|
if (newFlag == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (newFlag.GetState() != FlagState.InBase)
|
||||||
|
return;
|
||||||
|
|
||||||
spellId = info.NewFlag.pickupSpell;
|
spellId = info.NewFlag.pickupSpell;
|
||||||
spellCaster = null;
|
spellCaster = null;
|
||||||
break;
|
break;
|
||||||
@@ -2382,6 +2389,13 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
if (owner.GetGoType() == GameObjectTypes.NewFlag)
|
if (owner.GetGoType() == GameObjectTypes.NewFlag)
|
||||||
{
|
{
|
||||||
|
GameObjectType.NewFlag newFlag = (GameObjectType.NewFlag)m_goTypeImpl;
|
||||||
|
if (newFlag == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (newFlag.GetState() != FlagState.Dropped)
|
||||||
|
return;
|
||||||
|
|
||||||
// friendly with enemy flag means you're taking it
|
// friendly with enemy flag means you're taking it
|
||||||
bool defenderInteract = !owner.IsFriendlyTo(user);
|
bool defenderInteract = !owner.IsFriendlyTo(user);
|
||||||
if (defenderInteract && owner.GetGoInfo().NewFlag.ReturnonDefenderInteract != 0)
|
if (defenderInteract && owner.GetGoInfo().NewFlag.ReturnonDefenderInteract != 0)
|
||||||
@@ -4373,6 +4387,8 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
return _state != FlagState.InBase;
|
return _state != FlagState.InBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FlagState GetState() { return _state; }
|
||||||
}
|
}
|
||||||
|
|
||||||
class SetNewFlagState : GameObjectTypeBase.CustomCommand
|
class SetNewFlagState : GameObjectTypeBase.CustomCommand
|
||||||
|
|||||||
Reference in New Issue
Block a user