teleport to runegate power action fix for closest gate

This commit is contained in:
2024-08-27 19:43:31 -05:00
parent 9fb2e4ff1b
commit f93b1ce30e
@@ -45,13 +45,10 @@ public class RunegateTeleportPowerAction extends AbstractPowerAction {
Vector3fImmutable rgLoc;
for (Runegate runegate : Runegate._runegates.values()) {
rgLoc = runegate.gateBuilding.getLoc();
float distanceToRunegateSquared = source.getLoc().distanceSquared2D(rgLoc);
if (distanceToRunegateSquared < sqr(dist)) {
dist = sqrt(distanceToRunegateSquared);
float disToGate = source.getLoc().distanceSquared2D(rgLoc);
if(disToGate < dist){
dist = disToGate;
rg = runegate.gateBuilding;
}
}