forked from MagicBane/Server
Duplicate region field removed and inlined.
This commit is contained in:
@@ -390,16 +390,16 @@ public class InfoCmd extends AbstractDevCmd {
|
|||||||
output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum();
|
output += "Parent Zone LoadNum : " + targetNPC.getParentZone().getLoadNum();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetNPC.getRegion() != null){
|
if (targetNPC.region != null) {
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "BuildingID : " + targetNPC.getRegion().parentBuildingID;
|
output += "BuildingID : " + targetNPC.region.parentBuildingID;
|
||||||
output += "building level : " + targetNPC.getRegion().level;
|
output += "building level : " + targetNPC.region.level;
|
||||||
output += "building room : " + targetNPC.getRegion().room;
|
output += "building room : " + targetNPC.region.room;
|
||||||
}else if(targetNPC.getBuilding() != null) {
|
} else if (targetNPC.getBuilding() != null) {
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "Building : " + targetNPC.getBuilding();
|
output += "Building : " + targetNPC.getBuilding();
|
||||||
}else{
|
} else {
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "No building found.";
|
output += "No building found.";
|
||||||
}
|
}
|
||||||
@@ -463,13 +463,13 @@ public class InfoCmd extends AbstractDevCmd {
|
|||||||
output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum();
|
output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum();
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "isMoving : " + targetMob.isMoving();
|
output += "isMoving : " + targetMob.isMoving();
|
||||||
if (targetMob.getRegion() != null){
|
if (targetMob.region != null) {
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "BuildingID : " + targetMob.getRegion().parentBuildingID;
|
output += "BuildingID : " + targetMob.region.parentBuildingID;
|
||||||
output += "building level : " + targetMob.getRegion().level;
|
output += "building level : " + targetMob.region.level;
|
||||||
output += "building room : " + targetMob.getRegion().room;
|
output += "building room : " + targetMob.region.room;
|
||||||
}
|
}
|
||||||
if(targetMob.building != null) {
|
if (targetMob.building != null) {
|
||||||
output += "Building Name: " + targetMob.building.getName() + newline;
|
output += "Building Name: " + targetMob.building.getName() + newline;
|
||||||
output += "BuildingID : " + targetMob.building + newline;
|
output += "BuildingID : " + targetMob.building + newline;
|
||||||
output += "Bind Loc : " + targetMob.getBindLoc() + newline;
|
output += "Bind Loc : " + targetMob.getBindLoc() + newline;
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ public class PrintLocationCmd extends AbstractDevCmd {
|
|||||||
throwbackInfo(pc, "Lat: " + tar.getLoc().getX());
|
throwbackInfo(pc, "Lat: " + tar.getLoc().getX());
|
||||||
throwbackInfo(pc, "Lon: " + -tar.getLoc().getZ());
|
throwbackInfo(pc, "Lon: " + -tar.getLoc().getZ());
|
||||||
throwbackInfo(pc, "Alt: " + tar.getLoc().getY());
|
throwbackInfo(pc, "Alt: " + tar.getLoc().getY());
|
||||||
if (pc.getRegion() != null) {
|
if (pc.region != null) {
|
||||||
this.throwbackInfo(pc, "Player Region Slope Position : " + Regions.SlopeLerpPercent(pc, pc.getRegion()));
|
this.throwbackInfo(pc, "Player Region Slope Position : " + Regions.SlopeLerpPercent(pc, pc.region));
|
||||||
this.throwbackInfo(pc, "Region Slope Magnitude : " + Regions.GetMagnitudeOfRegionSlope(pc.getRegion()));
|
this.throwbackInfo(pc, "Region Slope Magnitude : " + Regions.GetMagnitudeOfRegionSlope(pc.region));
|
||||||
this.throwbackInfo(pc, "Player Region Slope Magnitude : " + Regions.GetMagnitudeOfPlayerOnRegionSlope(pc.getRegion(), pc));
|
this.throwbackInfo(pc, "Player Region Slope Magnitude : " + Regions.GetMagnitudeOfPlayerOnRegionSlope(pc.region, pc));
|
||||||
}else{
|
} else {
|
||||||
this.throwbackInfo(pc, "No Region Found for player.");
|
this.throwbackInfo(pc, "No Region Found for player.");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throwbackInfo(pc, "Server location for " + tar.getFirstName()
|
throwbackInfo(pc, "Server location for " + tar.getFirstName()
|
||||||
+ " not found");
|
+ " not found");
|
||||||
|
|||||||
@@ -27,18 +27,18 @@ public class RegionCmd extends AbstractDevCmd {
|
|||||||
AbstractGameObject target) {
|
AbstractGameObject target) {
|
||||||
|
|
||||||
|
|
||||||
if (pc.getRegion() == null){
|
if (pc.region == null) {
|
||||||
this.throwbackInfo(pc, "No Region Found.");
|
this.throwbackInfo(pc, "No Region Found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String newLine = System.getProperty("line.separator");
|
String newLine = System.getProperty("line.separator");
|
||||||
String result = "";
|
String result = "";
|
||||||
result+=(pc.getRegion().getClass().getSimpleName());
|
result += (pc.region.getClass().getSimpleName());
|
||||||
result+=( " {" );
|
result += (" {");
|
||||||
result+=(newLine);
|
result+=(newLine);
|
||||||
Field[] fields = pc.getRegion().getClass().getDeclaredFields();
|
Field[] fields = pc.region.getClass().getDeclaredFields();
|
||||||
|
|
||||||
//print field names paired with their values
|
//print field names paired with their values
|
||||||
for ( Field field : fields ) {
|
for ( Field field : fields ) {
|
||||||
@@ -51,7 +51,7 @@ public class RegionCmd extends AbstractDevCmd {
|
|||||||
result+=( field.getName());
|
result+=( field.getName());
|
||||||
result+=(": ");
|
result+=(": ");
|
||||||
//requires access to private field:
|
//requires access to private field:
|
||||||
result+=( field.get(pc.getRegion()).toString());
|
result += (field.get(pc.region).toString());
|
||||||
} catch ( IllegalAccessException ex ) {
|
} catch ( IllegalAccessException ex ) {
|
||||||
System.out.println(ex);
|
System.out.println(ex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ public enum BuildingManager {
|
|||||||
mob.setRank(rank);
|
mob.setRank(rank);
|
||||||
mob.setPlayerGuard(true);
|
mob.setPlayerGuard(true);
|
||||||
mob.BehaviourType = Enum.MobBehaviourType.GuardWallArcher;
|
mob.BehaviourType = Enum.MobBehaviourType.GuardWallArcher;
|
||||||
MovementManager.translocate(mob,mob.getBindLoc(),mob.getRegion());
|
MovementManager.translocate(mob, mob.getBindLoc(), mob.region);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (NPC.ISGuardCaptain(contract.getContractID())) {
|
if (NPC.ISGuardCaptain(contract.getContractID())) {
|
||||||
|
|||||||
@@ -168,24 +168,24 @@ public enum MovementManager {
|
|||||||
toMove.setInBuilding(-1);
|
toMove.setInBuilding(-1);
|
||||||
msg.setStartCoord(toMove.getLoc());
|
msg.setStartCoord(toMove.getLoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
//make sure we set the correct player.
|
//make sure we set the correct player.
|
||||||
msg.setSourceType(toMove.getObjectType().ordinal());
|
msg.setSourceType(toMove.getObjectType().ordinal());
|
||||||
msg.setSourceID(toMove.getObjectUUID());
|
msg.setSourceID(toMove.getObjectUUID());
|
||||||
|
|
||||||
//if player in region, modify location to local location of building. set target to building.
|
//if player in region, modify location to local location of building. set target to building.
|
||||||
if (toMove.getRegion() != null){
|
if (toMove.region != null) {
|
||||||
Building regionBuilding = Regions.GetBuildingForRegion(toMove.getRegion());
|
Building regionBuilding = Regions.GetBuildingForRegion(toMove.region);
|
||||||
if (regionBuilding != null){
|
if (regionBuilding != null) {
|
||||||
msg.setStartCoord(ZoneManager.convertWorldToLocal(Regions.GetBuildingForRegion(toMove.getRegion()), toMove.getLoc()));
|
msg.setStartCoord(ZoneManager.convertWorldToLocal(Regions.GetBuildingForRegion(toMove.region), toMove.getLoc()));
|
||||||
msg.setEndCoord(ZoneManager.convertWorldToLocal(regionBuilding, endLocation));
|
msg.setEndCoord(ZoneManager.convertWorldToLocal(regionBuilding, endLocation));
|
||||||
msg.setInBuilding(toMove.getRegion().level);
|
msg.setInBuilding(toMove.region.level);
|
||||||
msg.setUnknown01(toMove.getRegion().room);
|
msg.setUnknown01(toMove.region.room);
|
||||||
msg.setTargetType(GameObjectType.Building.ordinal());
|
msg.setTargetType(GameObjectType.Building.ordinal());
|
||||||
msg.setTargetID(regionBuilding.getObjectUUID());
|
msg.setTargetID(regionBuilding.getObjectUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
toMove.setInBuildingID(0);
|
toMove.setInBuildingID(0);
|
||||||
toMove.setInFloorID(-1);
|
toMove.setInFloorID(-1);
|
||||||
toMove.setInBuilding(-1);
|
toMove.setInBuilding(-1);
|
||||||
|
|||||||
@@ -55,14 +55,14 @@ public class FinishSummonsJob extends AbstractScheduleJob {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, SourceType.SUMMON)){
|
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, SourceType.SUMMON)) {
|
||||||
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
|
||||||
ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!");
|
ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.source.getRegion() != null)
|
if (this.source.region != null)
|
||||||
this.target.setRegion(this.source.getRegion());
|
this.target.setRegion(this.source.region);
|
||||||
//teleport target to source
|
//teleport target to source
|
||||||
target.teleport(source.getLoc());
|
target.teleport(source.getLoc());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ public class Bounds {
|
|||||||
|
|
||||||
|
|
||||||
//player is inside building region, skip collision check. we only do collision from the outside.
|
//player is inside building region, skip collision check. we only do collision from the outside.
|
||||||
if (player.getRegion() != null && player.getRegion().parentBuildingID == building.getObjectUUID())
|
if (player.region != null && player.region.parentBuildingID == building.getObjectUUID())
|
||||||
continue;
|
continue;
|
||||||
if (building.getBounds().colliders == null)
|
if (building.getBounds().colliders == null)
|
||||||
continue;
|
continue;
|
||||||
@@ -366,7 +366,7 @@ public class Bounds {
|
|||||||
for (Colliders collider: building.getBounds().colliders) {
|
for (Colliders collider: building.getBounds().colliders) {
|
||||||
|
|
||||||
//links are what link together buildings, allow players to run through them only if they are in a building already.
|
//links are what link together buildings, allow players to run through them only if they are in a building already.
|
||||||
if (collider.isLink() && player.getRegion() != null)
|
if (collider.isLink() && player.region != null)
|
||||||
continue;
|
continue;
|
||||||
if (collider.getDoorID() != 0 && building.isDoorOpen(collider.getDoorID()))
|
if (collider.getDoorID() != 0 && building.isDoorOpen(collider.getDoorID()))
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
if (pc.isSwimming())
|
if (pc.isSwimming())
|
||||||
return false;
|
return false;
|
||||||
if (pc.getRegion() != null && !pc.getRegion().isOutside())
|
if (pc.region != null && !pc.region.isOutside())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ public class ChangeAltitudeHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
pc.landingRegion = null;
|
pc.landingRegion = null;
|
||||||
if (pc.getAltitude() == 0){
|
if (pc.getAltitude() == 0){
|
||||||
Regions upRegion = pc.getRegion();
|
Regions upRegion = pc.region;
|
||||||
if (upRegion != null){
|
if (upRegion != null){
|
||||||
float startAlt = 0;
|
float startAlt = 0;
|
||||||
Building regionBuilding = Regions.GetBuildingForRegion(upRegion);
|
Building regionBuilding = Regions.GetBuildingForRegion(upRegion);
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ public class LoadCharacterMsg extends ClientNetMsg {
|
|||||||
NPC npc = (NPC) absChar;
|
NPC npc = (NPC) absChar;
|
||||||
|
|
||||||
if (npc.region != null) {
|
if (npc.region != null) {
|
||||||
writer.putInt(npc.getRegion().getLevel());
|
writer.putInt(npc.region.getLevel());
|
||||||
writer.putInt(npc.getRegion().getRoom());
|
writer.putInt(npc.region.getRoom());
|
||||||
} else {
|
} else {
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
@@ -85,7 +85,7 @@ public class LoadCharacterMsg extends ClientNetMsg {
|
|||||||
} else if (absChar != null) {
|
} else if (absChar != null) {
|
||||||
|
|
||||||
if (absChar.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
if (absChar.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||||
Regions region = absChar.getRegion();
|
Regions region = absChar.region;
|
||||||
|
|
||||||
if (region == null) {
|
if (region == null) {
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
@@ -102,7 +102,7 @@ public class LoadCharacterMsg extends ClientNetMsg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (absChar.getObjectType().equals(GameObjectType.Mob)){
|
else if (absChar.getObjectType().equals(GameObjectType.Mob)){
|
||||||
Regions region = absChar.getRegion();
|
Regions region = absChar.region;
|
||||||
|
|
||||||
if (region == null){
|
if (region == null){
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
|
|||||||
@@ -74,18 +74,18 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void _serialize(ByteBufferWriter writer) {
|
protected void _serialize(ByteBufferWriter writer) {
|
||||||
|
|
||||||
Regions region = this.ch.getRegion();
|
Regions region = this.ch.region;
|
||||||
//region loading seralization. serialzes building level and floor. -1 = not in building.
|
//region loading seralization. serialzes building level and floor. -1 = not in building.
|
||||||
if (region == null){
|
if (region == null) {
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
}else{
|
} else {
|
||||||
Building regionBuilding = Regions.GetBuildingForRegion(region);
|
Building regionBuilding = Regions.GetBuildingForRegion(region);
|
||||||
if (regionBuilding == null){
|
if (regionBuilding == null) {
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
writer.putInt(-1);
|
writer.putInt(-1);
|
||||||
}else{
|
} else {
|
||||||
writer.putInt(region.getLevel());
|
writer.putInt(region.getLevel());
|
||||||
writer.putInt(region.getRoom());
|
writer.putInt(region.getRoom());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,21 +42,20 @@ public class TeleportToPointMsg extends ClientNetMsg {
|
|||||||
if (targetID != 0){
|
if (targetID != 0){
|
||||||
this.targetType = GameObjectType.Building.ordinal();
|
this.targetType = GameObjectType.Building.ordinal();
|
||||||
this.targetUUID = (int) targetID;
|
this.targetUUID = (int) targetID;
|
||||||
}else{
|
} else {
|
||||||
this.targetType = 0;
|
this.targetType = 0;
|
||||||
this.targetUUID = 0;
|
this.targetUUID = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.unknown01 = unknown01;
|
this.unknown01 = unknown01;
|
||||||
this.unknown02 = unknown02;
|
this.unknown02 = unknown02;
|
||||||
|
|
||||||
if (ago.getRegion() != null){
|
if (ago.region != null) {
|
||||||
this.targetType = GameObjectType.Building.ordinal();
|
this.targetType = GameObjectType.Building.ordinal();
|
||||||
this.targetUUID = ago.getRegion().parentBuildingID;
|
this.targetUUID = ago.region.parentBuildingID;
|
||||||
this.unknown01 = ago.getRegion().level;
|
this.unknown01 = ago.region.level;
|
||||||
this.unknown02 = ago.getRegion().room;
|
this.unknown02 = ago.region.room;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
protected GridObjectType gridObjectType;
|
protected GridObjectType gridObjectType;
|
||||||
|
|
||||||
protected float altitude = 0;
|
protected float altitude = 0;
|
||||||
protected Regions region;
|
public Regions region;
|
||||||
protected boolean movingUp = false;
|
protected boolean movingUp = false;
|
||||||
public Regions landingRegion = null;
|
public Regions landingRegion = null;
|
||||||
public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO;
|
public Vector3fImmutable lastLoc = Vector3fImmutable.ZERO;
|
||||||
@@ -608,10 +608,6 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
return gridObjectType;
|
return gridObjectType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Regions getRegion() {
|
|
||||||
return region;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public boolean isMovingUp() {
|
public boolean isMovingUp() {
|
||||||
return movingUp;
|
return movingUp;
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ public class NPC extends AbstractCharacter {
|
|||||||
private String nameOverride = "";
|
private String nameOverride = "";
|
||||||
private int equipmentSetID = 0;
|
private int equipmentSetID = 0;
|
||||||
public int runeSetID = 0;
|
public int runeSetID = 0;
|
||||||
public Regions region = null;
|
|
||||||
|
|
||||||
private int repairCost = 5;
|
private int repairCost = 5;
|
||||||
public int extraRune2 = 0;
|
public int extraRune2 = 0;
|
||||||
|
|||||||
@@ -2054,17 +2054,17 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
writer.putInt(playerCharacter.getHeadlightsAsInt());
|
writer.putInt(playerCharacter.getHeadlightsAsInt());
|
||||||
|
|
||||||
|
|
||||||
if (playerCharacter.getRegion() != null && !loginData){
|
if (playerCharacter.region != null && !loginData) {
|
||||||
Building building = Regions.GetBuildingForRegion(playerCharacter.getRegion());
|
Building building = Regions.GetBuildingForRegion(playerCharacter.region);
|
||||||
|
|
||||||
if (building == null){
|
if (building == null) {
|
||||||
writer.putInt(0);
|
writer.putInt(0);
|
||||||
writer.putInt(0);
|
writer.putInt(0);
|
||||||
}else{
|
} else {
|
||||||
writer.putInt(GameObjectType.Building.ordinal());
|
writer.putInt(GameObjectType.Building.ordinal());
|
||||||
writer.putInt(building.getObjectUUID());
|
writer.putInt(building.getObjectUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
writer.putInt(0);
|
writer.putInt(0);
|
||||||
|
|||||||
@@ -216,42 +216,42 @@ public class Regions {
|
|||||||
|
|
||||||
public static boolean CanEnterRegion(AbstractWorldObject worldObject, Regions toEnter){
|
public static boolean CanEnterRegion(AbstractWorldObject worldObject, Regions toEnter){
|
||||||
|
|
||||||
if (worldObject.getRegion() == null)
|
if (worldObject.region == null)
|
||||||
if (toEnter.level == 0 || toEnter.room == -1 || toEnter.exit)
|
if (toEnter.level == 0 || toEnter.room == -1 || toEnter.exit)
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (worldObject.getRegion().equals(toEnter))
|
if (worldObject.region.equals(toEnter))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (worldObject.getRegion().level == toEnter.level)
|
if (worldObject.region.level == toEnter.level)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//next region is stairs, if they are on the same level as stairs or 1 up, world object can enter.
|
//next region is stairs, if they are on the same level as stairs or 1 up, world object can enter.
|
||||||
if (toEnter.stairs)
|
if (toEnter.stairs)
|
||||||
if (worldObject.getRegion().level == toEnter.level || toEnter.level - 1 == worldObject.getRegion().level)
|
if (worldObject.region.level == toEnter.level || toEnter.level - 1 == worldObject.region.level)
|
||||||
return true;
|
return true;
|
||||||
if (worldObject.getRegion().stairs){
|
if (worldObject.region.stairs) {
|
||||||
|
|
||||||
boolean movingUp = false;
|
boolean movingUp = false;
|
||||||
|
|
||||||
boolean movingDown = false;
|
boolean movingDown = false;
|
||||||
float yLerp = worldObject.getRegion().lerpY(worldObject);
|
float yLerp = worldObject.region.lerpY(worldObject);
|
||||||
|
|
||||||
if (yLerp == (worldObject.getRegion().highLerp.y))
|
if (yLerp == (worldObject.region.highLerp.y))
|
||||||
movingUp = true;
|
movingUp = true;
|
||||||
else if (yLerp == (worldObject.getRegion().lowLerp.y))
|
else if (yLerp == (worldObject.region.lowLerp.y))
|
||||||
movingDown = true;
|
movingDown = true;
|
||||||
//Stairs are always considered on the bottom floor.
|
//Stairs are always considered on the bottom floor.
|
||||||
|
|
||||||
|
|
||||||
if (movingUp){
|
if (movingUp) {
|
||||||
if(toEnter.level == worldObject.getRegion().level + 1)
|
if (toEnter.level == worldObject.region.level + 1)
|
||||||
return true;
|
return true;
|
||||||
}else if (movingDown)
|
} else if (movingDown)
|
||||||
if (toEnter.level == worldObject.getRegion().level)
|
if (toEnter.level == worldObject.region.level)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -621,16 +621,16 @@ public class WorldServer {
|
|||||||
playerCharacter.stopMovement(playerCharacter.getLoc());
|
playerCharacter.stopMovement(playerCharacter.getLoc());
|
||||||
UpdateStateMsg updateStateMsg = new UpdateStateMsg();
|
UpdateStateMsg updateStateMsg = new UpdateStateMsg();
|
||||||
updateStateMsg.setPlayer(playerCharacter);
|
updateStateMsg.setPlayer(playerCharacter);
|
||||||
|
|
||||||
updateStateMsg.setActivity(5);
|
updateStateMsg.setActivity(5);
|
||||||
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, updateStateMsg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
||||||
|
|
||||||
if (playerCharacter.getRegion() != null)
|
if (playerCharacter.region != null)
|
||||||
if (PlayerCharacter.CanBindToBuilding(playerCharacter, playerCharacter.getRegion().parentBuildingID))
|
if (PlayerCharacter.CanBindToBuilding(playerCharacter, playerCharacter.region.parentBuildingID))
|
||||||
playerCharacter.bindBuilding = playerCharacter.getRegion().parentBuildingID;
|
playerCharacter.bindBuilding = playerCharacter.region.parentBuildingID;
|
||||||
else
|
else
|
||||||
playerCharacter.bindBuilding = 0;
|
playerCharacter.bindBuilding = 0;
|
||||||
|
|
||||||
playerCharacter.getLoadedObjects().clear();
|
playerCharacter.getLoadedObjects().clear();
|
||||||
playerCharacter.getLoadedStaticObjects().clear();
|
playerCharacter.getLoadedStaticObjects().clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user