diff --git a/playerbot/WorldPosition.cpp b/playerbot/WorldPosition.cpp index 954efc87..382659a1 100644 --- a/playerbot/WorldPosition.cpp +++ b/playerbot/WorldPosition.cpp @@ -856,9 +856,9 @@ bool WorldPosition::ClosestCorrectPoint(float maxRange, float maxHeight, uint32 bool WorldPosition::GetReachableRandomPointOnGround(const Player* bot, const float radius, const bool randomRange) { #ifndef MANGOSBOT_TWO - return getMap(bot->GetInstanceId())->GetReachableRandomPointOnGround(coord_x, coord_y, coord_z, radius, randomRange); + return getMap(bot ? bot->GetInstanceId() : getFirstInstanceId())->GetReachableRandomPointOnGround(coord_x, coord_y, coord_z, radius, randomRange); #else - return getMap(bot->GetInstanceId())->GetReachableRandomPointOnGround(bot->GetPhaseMask(), coord_x, coord_y, coord_z, radius, randomRange); + return getMap(bot ? bot->GetInstanceId() : getFirstInstanceId())->GetReachableRandomPointOnGround(bot->GetPhaseMask(), coord_x, coord_y, coord_z, radius, randomRange); #endif }