MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / BadFloor

Function BadFloor

TombEngine/Game/control/box.cpp:1477–1506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1475}
1476
1477bool BadFloor(int x, int y, int z, int boxHeight, int nextHeight, short roomNumber, LOTInfo* LOT)
1478{
1479 auto* floor = GetFloor(x, y, z, &roomNumber);
1480 if (floor->PathfindingBoxID == NO_VALUE)
1481 return true;
1482
1483 if (LOT->IsJumping)
1484 return false;
1485
1486 auto* box = &g_Level.PathfindingBoxes[floor->PathfindingBoxID];
1487 if (box->flags & LOT->BlockMask)
1488 return true;
1489
1490 int height = box->height;
1491 bool heightResult = false;
1492
1493 if ((boxHeight - height) > LOT->Step || (boxHeight - height) < LOT->Drop)
1494 heightResult = true;
1495
1496 if ((boxHeight - height) < -LOT->Step && height > nextHeight)
1497 heightResult = true;
1498
1499 if (LOT->Fly != NO_FLYING && y > (height + LOT->Fly))
1500 heightResult = true;
1501
1502 if (heightResult)
1503 AddBadBox(LOT, floor->PathfindingBoxID);
1504
1505 return heightResult;
1506}
1507
1508int CreatureCreature(short itemNumber)
1509{

Callers 1

CreaturePathfindFunction · 0.85

Calls 2

GetFloorFunction · 0.85
AddBadBoxFunction · 0.85

Tested by

no test coverage detected