Fix bestz to work on client or target. (#2323)

This commit is contained in:
Paul Coene 2022-07-23 13:03:20 -04:00 committed by GitHub
parent 20c639c872
commit 5af1620e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,13 +24,11 @@ void command_loc(Client *c, const Seperator *sep)
if (!zone->zonemap) {
c->Message(Chat::White, "Map not loaded for this zone.");
} else {
auto z = c->GetZ() + (c->GetSize() == 0.0 ? 6 : c->GetSize()) * HEAD_POSITION;
auto me = glm::vec3(c->GetX(), c->GetY(), z);
auto z = target->GetZ() + (target->GetSize() == 0.0 ? 6 : target->GetSize()) * HEAD_POSITION;
auto tarloc = glm::vec3(target->GetX(), target->GetY(), z);
glm::vec3 hit;
glm::vec3 bme(me);
bme.z -= 500;
auto best_z = zone->zonemap->FindBestZ(me, &hit);
auto best_z = zone->zonemap->FindBestZ(tarloc, &hit);
if (best_z != BEST_Z_INVALID) {
c->Message(