mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-06-24 08:55:34 +00:00
Improvements
* Use new ZYX Loops order in LevelRenderer::allChanged * Revert xt, yt, zt change in PathFinder * Fix return in PathFinder
This commit is contained in:
@@ -211,10 +211,6 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
{
|
||||
bool walkable = false;
|
||||
|
||||
int xt = Mth::floor(entity->x);
|
||||
int yt = Mth::floor(entity->y);
|
||||
int zt = Mth::floor(entity->z);
|
||||
|
||||
//Use 4J XZY Loops order instead of Mojang XYZ Loops orders
|
||||
for (int xx = x; xx < x + size->x; xx++)
|
||||
{
|
||||
@@ -246,6 +242,10 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
// 4J Stu - Use new getTileRenderShape passing in the tileId we have already got
|
||||
if (entity->level->getTileRenderShape(tileId) == Tile::SHAPE_RAIL)
|
||||
{
|
||||
int xt = Mth::floor(entity->x);
|
||||
int yt = Mth::floor(entity->y);
|
||||
int zt = Mth::floor(entity->z);
|
||||
|
||||
if (entity->level->getTileRenderShape(xt, yt, zt) == Tile::SHAPE_RAIL
|
||||
|| entity->level->getTileRenderShape(xt, yt - 1, zt) == Tile::SHAPE_RAIL)
|
||||
{
|
||||
@@ -279,9 +279,9 @@ int PathFinder::isFree(Entity *entity, int x, int y, int z, Node *size, bool avo
|
||||
return TYPE_BLOCKED;
|
||||
}
|
||||
}
|
||||
|
||||
return walkable ? TYPE_WALKABLE : TYPE_OPEN;
|
||||
}
|
||||
|
||||
return walkable ? TYPE_WALKABLE : TYPE_OPEN;
|
||||
}
|
||||
|
||||
// function reconstruct_path(came_from,current_node)
|
||||
|
||||
Reference in New Issue
Block a user