mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 19:32:25 +00:00
[Cleanup] Add client pointer validation to Zone::GetClosestZonePoint() (#3173)
# Notes - We were not validating pointer here, could cause issues.
This commit is contained in:
parent
b6d315d803
commit
407b003f7d
@ -1998,6 +1998,11 @@ void Zone::SetTime(uint8 hour, uint8 minute, bool update_world /*= true*/)
|
|||||||
ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Client* client, float max_distance) {
|
ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Client* client, float max_distance) {
|
||||||
LinkedListIterator<ZonePoint*> iterator(zone_point_list);
|
LinkedListIterator<ZonePoint*> iterator(zone_point_list);
|
||||||
ZonePoint* closest_zp = nullptr;
|
ZonePoint* closest_zp = nullptr;
|
||||||
|
|
||||||
|
if (!client) {
|
||||||
|
return closest_zp;
|
||||||
|
}
|
||||||
|
|
||||||
float closest_dist = FLT_MAX;
|
float closest_dist = FLT_MAX;
|
||||||
float max_distance2 = max_distance * max_distance;
|
float max_distance2 = max_distance * max_distance;
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user