mangosR2/mangos — Issue #418: Remove Demonic Circle on  arena Dalaran Sewers
Author: say1981
Created: 2011-10-11 06:42:35+00:00
State: open

Varloki complain deletes their portal in any place of arena, in a code there is an area where repeatedly checking goes for the co-ordinate of Z and portuet player if he highly (in a pipe), why left the delete of object not clear ..

Варлоки жалуются удаляет их портал в любом месте арены, в коде есть участок где повторно идёт проверка на координату Z и портует игрока если он высоко (в трубе), зачем оставили удаление объекта не понятно ...

```
void BattleGroundDS::Update(uint32 diff)
{
BattleGround::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
// push people from the tubes
//if (pushbackCheck)

// knockback
if (m_uiKnockback < diff)
{
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
continue;

- if (GameObject* obj = plr->GetGameObject(48018)) // Remove Demonic Circle
- obj->Delete();
-
if (plr->GetPositionZ() < 11.0f)
continue;

float angle = (plr->GetBGTeam() == ALLIANCE /*gold*/) ? plr->GetAngle(1259.58f, 764.43f) : plr->GetAngle(1325.84f, 817.304f);

plr->KnockBackPlayerWithAngle(angle, 45, 7);

if (plr->IsWithinDist2d(1214, 765, 50) && plr->IsWithinLOS(1214, 765, 14))
plr->KnockBackPlayerWithAngle(6.40f,55,7);

if (plr->IsWithinDist2d(1369, 817, 50) && plr->IsWithinLOS(1369, 817, 14))
plr->KnockBackPlayerWithAngle(3.03f,55,7);
}
pushbackCheck = false;
m_uiKnockback = 1000;
}
else
m_uiKnockback -= diff;

// in case pushback failed
if (teleportCheck)
{
if (m_uiTeleport < diff)
{
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
{
if (plr->GetPositionZ() < 11.0f)
continue;

float x, y;
if (plr->GetBGTeam() == ALLIANCE)
{
x = 1259.58f;
y = 764.43f;
}
else
{
x = 1325.84f;
y = 817.304f;
}
plr->TeleportTo(GetMapId(), x + urand(0,2), y + urand(0,2), 3.15f, plr->GetOrientation());
}
}

teleportCheck = false;

// close the gate
OpenDoorEvent(BG_EVENT_DOOR);
}
else
m_uiTeleport -= diff;
}

// Waterfall
if (m_uiWaterfall < diff)
{
if (waterfallActivated)
{
SpawnEvent(WATERFALL_EVENT, 0, false);
waterfallActivated = false;
}
else
{
SpawnEvent(WATERFALL_EVENT, 0, true);
waterfallActivated = true;

for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
Player * plr = sObjectMgr.GetPlayer(itr->first);
if (plr && plr->GetDistance2d(1291, 790) <= 6)
plr->KnockBackFrom(plr, -20.0f, 9.0f);
}
}
m_uiWaterfall = urand(30,45)*IN_MILLISECONDS;
}
else
m_uiWaterfall -= diff;
}
}