Browse Source

inBuildingLoc removed.

master
MagicBot 2 years ago
parent
commit
40e4770425
  1. 5
      src/engine/devcmd/cmds/InfoCmd.java
  2. 20
      src/engine/objects/NPC.java

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

@ -399,16 +399,11 @@ public class InfoCmd extends AbstractDevCmd { @@ -399,16 +399,11 @@ public class InfoCmd extends AbstractDevCmd {
}else if(targetNPC.getBuilding() != null) {
output += newline;
output += "Building : " + targetNPC.getBuilding();
output += "In BuildingLoc : " + targetNPC.inBuildingLoc;
}else{
output += newline;
output += "No building found.";
}
break;
case Mob:
Mob targetMob = (Mob) target;
output += "databaseID: " + targetMob.getDBID() + newline;

20
src/engine/objects/NPC.java

@ -43,9 +43,6 @@ import static engine.objects.MobBase.loadEquipmentSet; @@ -43,9 +43,6 @@ import static engine.objects.MobBase.loadEquipmentSet;
public class NPC extends AbstractCharacter {
//This is called every 10 minutes to remove items from static npc inventory to make room to buy more.
private static int NUM_ITEMS_TO_JUNK = 30;
// Used for thread safety
public final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
@ -96,7 +93,6 @@ public class NPC extends AbstractCharacter { @@ -96,7 +93,6 @@ public class NPC extends AbstractCharacter {
public int runeSetID = 0;
private Regions region = null;
public Vector3fImmutable inBuildingLoc = Vector3fImmutable.ZERO;
private int repairCost = 5;
public int extraRune2 = 0;
@ -265,8 +261,10 @@ public class NPC extends AbstractCharacter { @@ -265,8 +261,10 @@ public class NPC extends AbstractCharacter {
if (this.upgradeDateTime != null)
submitUpgradeJob();
this.buildingFloor = (rs.getInt("npc_buildingFloor"));
this.buildingLevel = (rs.getInt("npc_buildingLevel"));
this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID));
if (this.contract != null)
@ -633,13 +631,10 @@ public class NPC extends AbstractCharacter { @@ -633,13 +631,10 @@ public class NPC extends AbstractCharacter {
writer.putFloat(1.0f);
writer.putFloat(1.0f);
if (npc.region != null)
writer.putVector3f(npc.inBuildingLoc);
else{
writer.putFloat(npc.getLoc().getX());
writer.putFloat(npc.getLoc().getY());
writer.putFloat(npc.getLoc().getZ());
}
writer.putFloat(npc.getLoc().getX());
writer.putFloat(npc.getLoc().getY());
writer.putFloat(npc.getLoc().getZ());
//Rotation
float radians = (float) Math.asin(npc.getRot().y) * 2;
@ -926,11 +921,8 @@ public class NPC extends AbstractCharacter { @@ -926,11 +921,8 @@ public class NPC extends AbstractCharacter {
this.region = BuildingManager.GetRegion(this.building, buildingWorldLoc.x, buildingWorldLoc.y, buildingWorldLoc.z);
if (this.region != null){
this.buildingFloor = region.getRoom();
this.buildingLevel = region.getLevel();
this.inBuildingLoc = ZoneManager.convertWorldToLocal(building, this.getLoc());
}else{
this.buildingFloor = -1;
this.buildingLevel = -1;

Loading…
Cancel
Save