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

Function GetSector

TombEngine/Game/room.cpp:754–764  ·  view source on GitHub ↗

TODO: Can use floordata's GetRoomGridCoord()?

Source from the content-addressed store, hash-verified

752{
753 // TODO: Can use floordata's GetRoomGridCoord()?
754 FloorInfo* GetSector(RoomData* room, int x, int z)
755 {
756 int sectorX = std::clamp(x / BLOCK(1), 0, room->XSize - 1);
757 int sectorZ = std::clamp(z / BLOCK(1), 0, room->ZSize - 1);
758
759 int sectorID = sectorZ + (sectorX * room->ZSize);
760 if (sectorID > room->Sectors.size())
761 return nullptr;
762
763 return &room->Sectors[sectorID];
764 }
765}
766
767bool IsPointInRoom(const Vector3i& pos, int roomNumber)

Callers 15

InitializeDoorFunction · 0.85
ControlGladiatorFunction · 0.85
RomanStatueControlFunction · 0.85
InitializeSmashObjectFunction · 0.85
InitializeItemFunction · 0.85
SameZoneFunction · 0.85
FindAITargetObjectFunction · 0.85
TargetReachableFunction · 0.85
CreatureAIInfoFunction · 0.85
AdjustStopperFlagFunction · 0.85
CreateZoneFunction · 0.85
Point.cppFile · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected