mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-01 09:18:00 +03:00
Fix no pathfinding
This commit is contained in:
parent
a016bb7f21
commit
6c39800d89
1 changed files with 9 additions and 10 deletions
|
@ -124,21 +124,20 @@ int LoadItems()
|
|||
InitialiseItem(i);
|
||||
}
|
||||
|
||||
for (int r = 0; r < g_Level.Rooms.size(); r++)
|
||||
for (auto& r : g_Level.Rooms)
|
||||
{
|
||||
MESH_INFO* mesh = g_Level.Rooms[r].mesh.data();
|
||||
|
||||
for (int m = 0; m < g_Level.Rooms[r].mesh.size(); m++)
|
||||
for (const auto& mesh : r.mesh)
|
||||
{
|
||||
FLOOR_INFO* floor = &g_Level.Rooms[r].floor[((mesh->z - g_Level.Rooms[r].z) / 1024) +
|
||||
g_Level.Rooms[r].xSize * ((mesh->x - g_Level.Rooms[r].x) / 1024)];
|
||||
FLOOR_INFO* floor = &r.floor[((mesh.z - r.z) / 1024) + r.xSize * ((mesh.x - r.x) / 1024)];
|
||||
|
||||
if (!(g_Level.Boxes[floor->box].flags & BLOCKED)
|
||||
&& !(CurrentLevel == 5 && (r == 19 || r == 23 || r == 16)))
|
||||
if (floor->box == -1)
|
||||
continue;
|
||||
|
||||
if (!(g_Level.Boxes[floor->box].flags & BLOCKED))
|
||||
{
|
||||
int fl = floor->floor * 4;
|
||||
STATIC_INFO* st = &StaticObjects[mesh->staticNumber];
|
||||
if (fl <= mesh->y - st->collisionBox.Y2 + 512 && fl < mesh->y - st->collisionBox.Y1)
|
||||
STATIC_INFO* st = &StaticObjects[mesh.staticNumber];
|
||||
if (fl <= mesh.y - st->collisionBox.Y2 + 512 && fl < mesh.y - st->collisionBox.Y1)
|
||||
{
|
||||
if (st->collisionBox.X1 == 0 || st->collisionBox.X2 == 0 ||
|
||||
st->collisionBox.Z1 == 0 || st->collisionBox.Z2 == 0 ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue