mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-14 05:52:04 +00:00
TU24
This commit is contained in:
@@ -217,7 +217,9 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
|
||||
//Use 4J XZY Loops order instead of Mojang XYZ Loops orders
|
||||
for (int xx = x; xx < x + size->x; xx++)
|
||||
{
|
||||
for (int zz = z; zz < z + size->z; zz++)
|
||||
{
|
||||
for (int yy = y; yy < y + size->y; yy++)
|
||||
{
|
||||
int tileId = entity->level->getTile(xx, yy, zz);
|
||||
@@ -225,7 +227,7 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
if(tileId <= 0)
|
||||
continue;
|
||||
|
||||
if (TrapDoorTile::isTrapDoor(tileId))
|
||||
if (tileId == Tile::trapdoor_Id)
|
||||
walkable = true;
|
||||
|
||||
else if (tileId == Tile::water_Id || tileId == Tile::calmWater_Id)
|
||||
@@ -236,7 +238,7 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
walkable = true;
|
||||
continue;
|
||||
}
|
||||
else if (!canPassDoors && DoorTile::isDoor(tileId))
|
||||
else if (!canPassDoors && tileId == Tile::door_wood_Id)
|
||||
return TYPE_BLOCKED;
|
||||
|
||||
Tile *tile = Tile::tiles[tileId];
|
||||
@@ -256,26 +258,30 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
if (tile->isPathfindable(entity->level, xx, yy, zz))
|
||||
continue;
|
||||
|
||||
if (canOpenDoors && DoorTile::isDoor(tileId))
|
||||
if (canOpenDoors && tileId == Tile::door_wood_Id)
|
||||
continue;
|
||||
|
||||
int renderShape = tile->getRenderShape();
|
||||
if (renderShape == Tile::SHAPE_FENCE || FenceGateTile::isFenceGate(tileId) || renderShape == Tile::SHAPE_WALL)
|
||||
if (renderShape == Tile::SHAPE_FENCE || tileId == Tile::fenceGate_Id || renderShape == Tile::SHAPE_WALL)
|
||||
return TYPE_FENCE;
|
||||
|
||||
if (TrapDoorTile::isTrapDoor(tileId))
|
||||
if (tileId == Tile::trapdoor_Id)
|
||||
return TYPE_TRAP;
|
||||
|
||||
Material *m = tile->material;
|
||||
if (m == Material::lava)
|
||||
{
|
||||
if (entity->isInLava()) continue;
|
||||
if (entity->isInLava())
|
||||
continue;
|
||||
|
||||
return TYPE_LAVA;
|
||||
}
|
||||
return TYPE_BLOCKED;
|
||||
}
|
||||
}
|
||||
|
||||
return walkable ? TYPE_WALKABLE : TYPE_OPEN;
|
||||
}
|
||||
}
|
||||
|
||||
// function reconstruct_path(came_from,current_node)
|
||||
|
||||
Reference in New Issue
Block a user