MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / IsDoorClear

Function IsDoorClear

Source/objects.cpp:1653–1659  ·  view source on GitHub ↗

* @brief Checks if an open door can be closed * * In order to be able to close a door the space where the closed door would be must be free of bodies, monsters, players, and items * * @param doorPosition Map tile where the door is in its closed position * @return true if the door is free to be closed, false if anything is blocking it */

Source from the content-addressed store, hash-verified

1651 * @return true if the door is free to be closed, false if anything is blocking it
1652 */
1653inline bool IsDoorClear(const Object &door)
1654{
1655 return dCorpse[door.position.x][door.position.y] == 0
1656 && dMonster[door.position.x][door.position.y] == 0
1657 && dItem[door.position.x][door.position.y] == 0
1658 && dPlayer[door.position.x][door.position.y] == 0;
1659}
1660
1661void UpdateDoor(Object &door)
1662{

Callers 2

UpdateDoorFunction · 0.85
OperateDoorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected