Browse Source

region heights issue

lakebane-jobs
FatBoy-DOTC 12 hours ago
parent
commit
5fabd31495
  1. 7
      src/engine/devcmd/cmds/InfoCmd.java
  2. 7
      src/engine/mobileAI/MobAI.java
  3. 19
      src/engine/objects/AbstractWorldObject.java
  4. 4
      src/engine/objects/PlayerCharacter.java

7
src/engine/devcmd/cmds/InfoCmd.java

@ -342,8 +342,11 @@ public class InfoCmd extends AbstractDevCmd { @@ -342,8 +342,11 @@ public class InfoCmd extends AbstractDevCmd {
output += newline;
output += "isMoving : " + targetPC.isMoving();
output += newline;
output += "Zerg Multiplier : " + targetPC.ZergMultiplier+ newline;
output += "Hidden : " + targetPC.getHidden();
output += "Zerg Multiplier : " + targetPC.ZergMultiplier + newline;
output += "Hidden : " + targetPC.getHidden() + newline;
output += "Target Loc: " + targetPC.loc + newline;
output += "Player Loc: " + pc.loc + newline;
output += "Distance Squared: " + pc.loc.distanceSquared(targetPC.loc);
break;
case NPC:

7
src/engine/mobileAI/MobAI.java

@ -620,9 +620,6 @@ public class MobAI { @@ -620,9 +620,6 @@ public class MobAI {
if (mob == null)
return;
if(mob.isAlive())
if(!mob.getMovementLoc().equals(Vector3fImmutable.ZERO))
mob.setLoc(mob.getMovementLoc());
if (mob.getTimestamps().containsKey("lastExecution") == false)
mob.getTimestamps().put("lastExecution", System.currentTimeMillis());
@ -678,6 +675,10 @@ public class MobAI { @@ -678,6 +675,10 @@ public class MobAI {
return;
}
if(mob.isAlive())
if(!mob.getMovementLoc().equals(Vector3fImmutable.ZERO))
mob.setLoc(mob.getMovementLoc());
if(mob.isPet() == false && mob.isPlayerGuard == false)
CheckToSendMobHome(mob);

19
src/engine/objects/AbstractWorldObject.java

@ -15,6 +15,7 @@ import engine.Enum.GameObjectType; @@ -15,6 +15,7 @@ import engine.Enum.GameObjectType;
import engine.Enum.GridObjectType;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.ZoneManager;
import engine.job.AbstractScheduleJob;
import engine.job.JobContainer;
import engine.job.JobScheduler;
@ -500,8 +501,24 @@ public abstract class AbstractWorldObject extends AbstractGameObject { @@ -500,8 +501,24 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
if (loc.x > MBServerStatics.MAX_WORLD_WIDTH || loc.z < MBServerStatics.MAX_WORLD_HEIGHT)
return;
this.lastLoc = new Vector3fImmutable(this.loc);
if(AbstractCharacter.IsAbstractCharacter(this)){
float y;
float worldHeight = HeightMap.getWorldHeight(loc);
Zone zone = ZoneManager.findSmallestZone(loc);
if(zone != null && zone.isPlayerCity()){
worldHeight = zone.absY;
}
if(this.region != null){
float regionAlt = this.region.lerpY(this);
float altitude = this.getAltitude();
y = regionAlt + altitude + worldHeight;
}else{
y = HeightMap.getWorldHeight(loc) + this.getAltitude();
}
loc.setY(y);
}
this.loc = loc;
this.loc = this.loc.setY(HeightMap.getWorldHeight(this) + this.getAltitude());
//this.loc = this.loc.setY(HeightMap.getWorldHeight(this) + this.getAltitude());
//lets not add mob to world grid if he is currently despawned.
if (this.getObjectType().equals(GameObjectType.Mob) && ((Mob) this).despawned)

4
src/engine/objects/PlayerCharacter.java

@ -5330,9 +5330,11 @@ public class PlayerCharacter extends AbstractCharacter { @@ -5330,9 +5330,11 @@ public class PlayerCharacter extends AbstractCharacter {
return;
}
setLoc(newLoc);
this.region = AbstractWorldObject.GetRegionByWorldObject(this);
setLoc(newLoc);
if (this.getDebug(1))
ChatManager.chatSystemInfo(this,
"Distance to target " + this.getEndLoc().distance2D(this.getLoc()) + " speed " + this.getSpeed());

Loading…
Cancel
Save