Browse Source

finalized

magicbox-1.5.2
FatBoy-DOTC 1 year ago
parent
commit
7a1700cec3
  1. 6
      src/engine/objects/AbstractCharacter.java

6
src/engine/objects/AbstractCharacter.java

@ -991,10 +991,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject { @@ -991,10 +991,12 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
Regions region = null;
if(building != null) {
//look for region in the building we are in
for(Regions regionCycle : building.getBounds().getRegions())
if(regionCycle.isPointInPolygon(value) && Math.abs(regionCycle.highLerp.y - value.y) < 10)
for (Regions regionCycle : building.getBounds().getRegions()) {
float regionHeight = regionCycle.highLerp.y - regionCycle.lowLerp.y;
if (regionCycle.isPointInPolygon(value) && Math.abs(regionCycle.highLerp.y - value.y) < regionHeight)
region = regionCycle;
}
}
float regionHeightOffset = 0;
if(region != null){
this.region = region;

Loading…
Cancel
Save