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

Function CanPlaceRandomObject

Source/objects.cpp:384–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384bool CanPlaceRandomObject(Point position, Displacement standoff)
385{
386 for (int yy = -standoff.deltaY; yy <= standoff.deltaY; yy++) {
387 for (int xx = -standoff.deltaX; xx <= standoff.deltaX; xx++) {
388 Point tile = position + Displacement { xx, yy };
389 if (!RndLocOk(tile.x, tile.y))
390 return false;
391 }
392 }
393 return true;
394}
395
396std::optional<Point> GetRandomObjectPosition(Displacement standoff)
397{

Callers 1

GetRandomObjectPositionFunction · 0.85

Calls 1

RndLocOkFunction · 0.85

Tested by

no test coverage detected