finalized

This commit is contained in:
2023-10-18 20:17:26 -05:00
parent 79eb5b9cdf
commit 7a1700cec3
+5 -3
View File
@@ -989,12 +989,14 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
Building building = BuildingManager.getBuildingAtLocation(this.loc); Building building = BuildingManager.getBuildingAtLocation(this.loc);
Regions region = null; Regions region = null;
if(building != null){ if(building != null) {
//look for region in the building we are in //look for region in the building we are in
for(Regions regionCycle : building.getBounds().getRegions()) for (Regions regionCycle : building.getBounds().getRegions()) {
if(regionCycle.isPointInPolygon(value) && Math.abs(regionCycle.highLerp.y - value.y) < 10) float regionHeight = regionCycle.highLerp.y - regionCycle.lowLerp.y;
if (regionCycle.isPointInPolygon(value) && Math.abs(regionCycle.highLerp.y - value.y) < regionHeight)
region = regionCycle; region = regionCycle;
} }
}
float regionHeightOffset = 0; float regionHeightOffset = 0;
if(region != null){ if(region != null){
this.region = region; this.region = region;