Revert "cleanup"

This reverts commit e128f60519.
This commit is contained in:
2023-10-27 23:17:16 -05:00
parent e128f60519
commit 67af6f8c18
3 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -584,7 +584,7 @@ public class MobAI {
if(mob.isPlayerGuard() || mob.isSiege()) { if(mob.isPlayerGuard() || mob.isSiege()) {
bypassLoadedPlayerCheck = true; bypassLoadedPlayerCheck = true;
if(mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) if(mob.combatTarget != null && mob.combatTarget.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if(mob.combatTarget.loc.distanceSquared(mob.loc) > 62500) if(mob.combatTarget.loc.distanceSquared(mob.loc) > 10000)
mob.setCombatTarget(null); mob.setCombatTarget(null);
} }
@@ -301,8 +301,6 @@ private static final int cellGap = 1;
} }
public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){ public static void pathfind(AbstractCharacter character, Vector3fImmutable goal){
try { try {
if(character.isMoving())
return;
if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building if(character.region == null && Regions.getRegionAtLocation(goal) != null) {//mover not inside a building
Building building = BuildingManager.getBuildingAtLocation(goal); Building building = BuildingManager.getBuildingAtLocation(goal);
@@ -395,10 +393,14 @@ private static final int cellGap = 1;
if (path.contains(cheapCorner)) { if (path.contains(cheapCorner)) {
continue; continue;
}else { }else {
path.add(cheapCorner); path.add(cheapCorner);
current = cheapCorner; current = cheapCorner;
continue; continue;
} }
if (path.contains(point))
continue;
} }
if (path.contains(point)) if (path.contains(point))
@@ -406,8 +408,9 @@ private static final int cellGap = 1;
Regions region = Regions.getRegionAtLocation(point); Regions region = Regions.getRegionAtLocation(point);
if(region != null) { if(region != null) {
path.add(new Vector3fImmutable(region.center)); //only use center points when travelling through regions path.add(new Vector3fImmutable(region.center.x,region.center.y,region.center.z)); //only use center points when travelling through regions
continue; continue;
} }
if (pointIsBlocked(point)) { if (pointIsBlocked(point)) {
-3
View File
@@ -9,7 +9,6 @@
package engine.objects; package engine.objects;
import com.sun.prism.Mesh;
import engine.Enum; import engine.Enum;
import engine.Enum.*; import engine.Enum.*;
import engine.InterestManagement.RealmMap; import engine.InterestManagement.RealmMap;
@@ -1537,8 +1536,6 @@ public class Building extends AbstractWorldObject {
} }
public void updateNavMesh(){ public void updateNavMesh(){
//TODO figure out how to subtract the mesh of the building form the navMesh
for(Regions region : this.getBounds().getRegions()) for(Regions region : this.getBounds().getRegions())
this.parentZone.navMesh.add(region.getArea()); this.parentZone.navMesh.add(region.getArea());
} }