Improved check (#1831)

- Increased the range in which we search for the desired gameobject
- Added a check in case this gameobject exists
This commit is contained in:
Pondaveia
2019-05-26 14:05:51 +01:00
committed by Knindza
parent 337820db0f
commit e4c33b46cb

View File

@@ -771,9 +771,9 @@ public:
for (uint8 i = 0; i < 12; ++i)
{
if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 30))
if (GameObject* temp_prison = me->FindNearestGameObject(acherus_soul_prison[i], 100))
{
if (me->IsWithinDist(temp_prison, dist, false))
if (temp_prison && me->IsWithinDist(temp_prison, dist, false))
{
dist = me->GetDistance2d(temp_prison);
prison = temp_prison;