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

Function IsItemBlockingObjectAtPosition

Source/objects.cpp:3757–3781  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3755}
3756
3757bool IsItemBlockingObjectAtPosition(Point position)
3758{
3759 Object *object = FindObjectAtPosition(position);
3760 if (object != nullptr && object->_oSolidFlag) {
3761 // solid object
3762 return true;
3763 }
3764
3765 object = FindObjectAtPosition(position + Direction::South);
3766 if (object != nullptr && object->_oSelFlag != 0) {
3767 // An unopened container or breakable object exists which potentially overlaps this tile, the player might not be able to pick up an item dropped here.
3768 return true;
3769 }
3770
3771 object = FindObjectAtPosition(position + Direction::SouthEast, false);
3772 if (object != nullptr) {
3773 Object *otherDoor = FindObjectAtPosition(position + Direction::SouthWest, false);
3774 if (otherDoor != nullptr && object->_oSelFlag != 0 && otherDoor->_oSelFlag != 0) {
3775 // Two interactive objects potentially overlap both sides of this tile, as above the player might not be able to pick up an item which is dropped here.
3776 return true;
3777 }
3778 }
3779
3780 return false;
3781}
3782
3783void LoadLevelObjects(uint16_t filesWidths[65])
3784{

Callers 2

CanPutFunction · 0.85
ItemSpaceOkFunction · 0.85

Calls 1

FindObjectAtPositionFunction · 0.85

Tested by

no test coverage detected