MCPcopy Create free account
hub / github.com/DFHack/dfhack / getExtentTile

Function getExtentTile

library/modules/Buildings.cpp:119–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117static unordered_map<df::coord, int32_t, CoordHash> locationToBuilding;
118
119static df::building_extents_type *getExtentTile(const df::building::T_room &room, df::coord2d tile)
120{
121 if (!room.extents)
122 return NULL;
123 int dx = tile.x - room.x;
124 int dy = tile.y - room.y;
125 if (dx < 0 || dy < 0 || dx >= room.width || dy >= room.height)
126 return NULL;
127 return &room.extents[dx + dy*room.width];
128}
129
130/*
131 * A monitor to work around this bug, in its application to buildings:

Callers 6

findAtTileMethod · 0.85
findCivzonesAtMethod · 0.85
checkFreeTilesMethod · 0.85
containsTileMethod · 0.85
markBuildingTilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected