From b069d57d378850531aefc53fa0b3785112605b91 Mon Sep 17 00:00:00 2001 From: mostlikely4r Date: Tue, 15 Oct 2024 14:52:38 +0200 Subject: [PATCH] -Internal: Reachablerandompoint is now also usable without a bot reference. --- playerbot/WorldPosition.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }