Browse Source

Siege bounds related bonus code removal.

master
MagicBot 2 years ago
parent
commit
ffafd44fa7
  1. 50
      src/engine/gameManager/ZoneManager.java
  2. 5
      src/engine/net/client/handlers/PlaceAssetMsgHandler.java
  3. 5
      src/engine/objects/Bane.java

50
src/engine/gameManager/ZoneManager.java

@ -271,24 +271,6 @@ public enum ZoneManager { @@ -271,24 +271,6 @@ public enum ZoneManager {
return true;
}
/**
* Gets a MacroZone by name.
*
* @param inputName MacroZone name to search for
* @return Zone of the MacroZone, or Null
*/
public static Zone findMacroZoneByName(String inputName) {
synchronized (ZoneManager.macroZones) {
for (Zone zone : ZoneManager.macroZones) {
String zoneName = zone.getName();
if (zoneName.equalsIgnoreCase(inputName))
return zone;
}
}
return null;
}
// Converts world coordinates to coordinates local to a given zone.
public static Vector3fImmutable worldToLocal(Vector3fImmutable worldVector,
@ -353,10 +335,11 @@ public enum ZoneManager { @@ -353,10 +335,11 @@ public enum ZoneManager {
// convert from SB rotation value to radians
if (building.getBounds().getQuaternion() == null)
return building.getLoc();
Vector3fImmutable rotatedLocal = Vector3fImmutable.rotateAroundPoint(Vector3fImmutable.ZERO, localPos, building.getBounds().getQuaternion());
// handle building rotation
// handle building translation
@ -371,6 +354,7 @@ public enum ZoneManager { @@ -371,6 +354,7 @@ public enum ZoneManager {
Vector3f rotatedLocal = Vector3f.rotateAroundPoint(Vector3f.ZERO, localPos, bounds.getQuaternion());
// handle building rotation
// handle building translation
@ -380,7 +364,6 @@ public enum ZoneManager { @@ -380,7 +364,6 @@ public enum ZoneManager {
public static Vector3fImmutable convertWorldToLocal(Building building, Vector3fImmutable WorldPos) {
Vector3fImmutable convertLoc = Vector3fImmutable.rotateAroundPoint(building.getLoc(), WorldPos, -building.getBounds().getQuaternion().angleY);
convertLoc = convertLoc.subtract(building.getLoc());
// convert from SB rotation value to radians
@ -389,14 +372,8 @@ public enum ZoneManager { @@ -389,14 +372,8 @@ public enum ZoneManager {
}
public static Vector3fImmutable convertNPCLoc(Building building, Vector3fImmutable npcLoc) {
return Vector3fImmutable.rotateAroundPoint(Vector3fImmutable.ZERO, npcLoc, -building.getBounds().getQuaternion().angleY);
}
// Method returns a city if the given location is within
// a city siege radius.
// a city zone.
public static City getCityAtLocation(Vector3fImmutable worldLoc) {
@ -409,25 +386,6 @@ public enum ZoneManager { @@ -409,25 +386,6 @@ public enum ZoneManager {
if (currentZone.isPlayerCity())
return City.getCity(currentZone.getPlayerCityUUID());
// Not currently on a city grid. Test nearby cities
// to see if we are on one of their seige bounds.
zoneList = currentZone.getNodes();
for (Zone zone : zoneList) {
if (zone == currentZone)
continue;
if (zone.isPlayerCity() == false)
continue;
city = City.getCity(zone.getPlayerCityUUID());
if (worldLoc.isInsideCircle(city.getLoc(), Enum.CityBoundsType.ZONE.extents))
return city;
}
return null;
}

5
src/engine/net/client/handlers/PlaceAssetMsgHandler.java

@ -346,11 +346,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler { @@ -346,11 +346,6 @@ public class PlaceAssetMsgHandler extends AbstractClientMsgHandler {
return false;
}
// Set the server zone to the city zone in order to account for being inside
// the siege bounds buffer area
serverZone = serverCity.getParent();
// Must belong to either attacker or defenders.
if ((player.getGuild().equals(serverCity.getBane().getOwner().getGuild()) == false)

5
src/engine/objects/Bane.java

@ -135,15 +135,14 @@ public final class Bane { @@ -135,15 +135,14 @@ public final class Bane {
return false;
}
// Cannot place banestones underwater;
// Cannot place banestone underwater;
if (HeightMap.isLocUnderwater(player.getLoc())) {
PlaceAssetMsg.sendPlaceAssetError(origin, 6, ""); // Cannot place underwater
return false;
}
// figure out which city we're standing on
// must be within a city's seige Bounds
// figure out which city zone we are standing on.
targetCity = ZoneManager.getCityAtLocation(player.getLoc());

Loading…
Cancel
Save