if ( getMarked() == null ) {
return;
}
Entity e;
Region r;
for (int d = 0; d < 4; d++) {
if ( getMarked().at(d) == Local.Self.tile ) {
if ((r = Local.Regions.get(getMarked().rid)) != null && r.type == 1 && r.id != Local.Self.tile.rid
&& !((e = Local.Entities.get(getMarked().id)) != null && e.getType() == Entity.Type.DOOR && e.parama == d)
|| (r = Local.Regions.get(Local.Self.tile.rid)) != null && r.type == 1 && r.id != getMarked().rid
&& !((e = Local.Entities.get(Local.Self.tile.id)) != null && e.getType() == Entity.Type.DOOR && e.parama == Main.opposite[d])) {
System.out.println("stubmling into region " + r.name);
return; // We tried going into or out of a building without there being a door.
} else if ((r = Local.Regions.get(getMarked().rid)) != null && r.type == 1 && (r = Local.Regions.get(Local.Self.tile.rid)) == null) {
// We went into a building.