Core/Spells: Clean up some gameobject types in EffectOpenLock (#29532)

This commit is contained in:
Jeremy
2023-12-28 19:46:50 +01:00
committed by GitHub
parent 88a7886e0d
commit 42de312a79
2 changed files with 9 additions and 10 deletions

View File

@@ -3281,6 +3281,15 @@ void GameObject::Use(Unit* user)
Delete();
return;
}
case GAMEOBJECT_TYPE_CAPTURE_POINT:
{
Player* player = user->ToPlayer();
if (!player)
return;
AssaultCapturePoint(player);
return;
}
case GAMEOBJECT_TYPE_ITEM_FORGE:
{
GameObjectTemplate const* info = GetGOInfo();

View File

@@ -1597,11 +1597,6 @@ void Spell::EffectOpenLock()
return;
}
}
else if (goInfo->type == GAMEOBJECT_TYPE_CAPTURE_POINT)
{
gameObjTarget->AssaultCapturePoint(player);
return;
}
else if (goInfo->type == GAMEOBJECT_TYPE_FLAGSTAND)
{
//CanUseBattlegroundObject() already called in CheckCast()
@@ -1613,11 +1608,6 @@ void Spell::EffectOpenLock()
return;
}
}
else if (goInfo->type == GAMEOBJECT_TYPE_NEW_FLAG)
{
gameObjTarget->Use(player);
return;
}
else if (m_spellInfo->Id == 1842 && gameObjTarget->GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && gameObjTarget->GetOwner())
{
gameObjTarget->SetLootState(GO_JUST_DEACTIVATED);