new region lookup
This commit is contained in:
1 parent
beb2b47162
commit
b928bedeb6
3 files changed
+35
-1
No files matched your search
@@ -985,7 +985,15 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
|
||||
@Override
|
||||
public final void setLoc(final Vector3fImmutable value) {
|
||||
Regions region = Regions.GetRegionForTeleport(value);
|
||||
|
||||
Building building = BuildingManager.getBuildingAtLocation(this.loc);
|
||||
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))
|
||||
region = regionCycle;
|
||||
}
|
||||
float regionHeightOffset = 0;
|
||||
if(region != null){
|
||||
this.region = region;
|
||||
|
||||
Reference in new issue
Block a user