Browse Source

stairs region corrected

magicbox-1.5.2
FatBoy-DOTC 1 year ago
parent
commit
79eb5b9cdf
  1. 3
      src/engine/devcmd/cmds/RegionCmd.java
  2. 2
      src/engine/objects/AbstractCharacter.java
  3. 9
      src/engine/objects/Regions.java

3
src/engine/devcmd/cmds/RegionCmd.java

@ -44,7 +44,8 @@ public class RegionCmd extends AbstractDevCmd {
output += "Player Info: " + ((AbstractCharacter) target).getName() + newline; output += "Player Info: " + ((AbstractCharacter) target).getName() + newline;
output += "Region Building: " + building.getName() + newline; output += "Region Building: " + building.getName() + newline;
output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline; output += "Region Height: " + region.lerpY((AbstractCharacter)target) + newline;
output += "is Stairs: " + region.stairs + newline; output += "is Stairs: " + region.isStairs() + newline;
output += "is Outside: " + region.isOutside();
this.throwbackInfo(pc, output); this.throwbackInfo(pc, output);
} }

2
src/engine/objects/AbstractCharacter.java

@ -27,6 +27,7 @@ import engine.math.Bounds;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.net.ByteBufferWriter; import engine.net.ByteBufferWriter;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.UpdateStateMsg; import engine.net.client.msg.UpdateStateMsg;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -1007,6 +1008,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
this.inBuildingID = 0; this.inBuildingID = 0;
this.inFloorID = -1; this.inFloorID = -1;
} }
float terrainHeight = Terrain.getWorldHeight(value); float terrainHeight = Terrain.getWorldHeight(value);
Vector3fImmutable finalLocation = new Vector3fImmutable(value.x,terrainHeight + regionHeightOffset, value.z); Vector3fImmutable finalLocation = new Vector3fImmutable(value.x,terrainHeight + regionHeightOffset, value.z);
super.setLoc(finalLocation); // set the location in the world super.setLoc(finalLocation); // set the location in the world

9
src/engine/objects/Regions.java

@ -170,10 +170,10 @@ public class Regions {
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.isStairs())
if (worldObject.region.level == toEnter.level || toEnter.level - 1 == worldObject.region.level) if (worldObject.region.level == toEnter.level || toEnter.level - 1 == worldObject.region.level)
return true; return true;
if (worldObject.region.stairs) { if (worldObject.region.isStairs()) {
boolean movingUp = false; boolean movingUp = false;
@ -239,7 +239,7 @@ public class Regions {
return true; return true;
//cant move up a level without stairs. //cant move up a level without stairs.
if (!fromRegion.stairs) if (!fromRegion.isStairs())
return false; return false;
boolean movingUp = false; boolean movingUp = false;
@ -367,7 +367,8 @@ public class Regions {
} }
public boolean isStairs() { public boolean isStairs() {
return stairs;
return this.highLerp.y - this.lowLerp.y > 0.25f;
} }
public boolean isExit() { public boolean isExit() {

Loading…
Cancel
Save