Merge pull request #293 from madsboddum/290

PvP zones are now only applied to the intended planet instead of every planet #290
This commit is contained in:
Josh Larson
2020-12-12 23:08:36 -05:00
committed by GitHub

View File

@@ -281,6 +281,11 @@ public class FactionFlagService extends Service {
return pvpZones.values().stream()
.anyMatch(pvpZone -> {
Location zoneLocation = pvpZone.getLocation();
if (location.getTerrain() != zoneLocation.getTerrain()) {
return false;
}
double radius = pvpZone.getRadius();
return location.isWithinFlatDistance(zoneLocation, radius);