MCPcopy Create free account
hub / github.com/NetHack/NetHack / cvt_to_relcoord

Function cvt_to_relcoord

src/sp_lev.c:4792–4802  ·  view source on GitHub ↗

inverse of cvt_to_abscoord; turn an absolute svl.level.locations coordinate * into one relative to the current map or room. */

Source from the content-addressed store, hash-verified

4790/* inverse of cvt_to_abscoord; turn an absolute svl.level.locations coordinate
4791 * into one relative to the current map or room. */
4792void
4793cvt_to_relcoord(coordxy *x, coordxy *y)
4794{
4795 if (gc.coder && gc.coder->croom) {
4796 *x -= gc.coder->croom->lx;
4797 *y -= gc.coder->croom->ly;
4798 } else {
4799 *x -= gx.xstart;
4800 *y -= gy.ystart;
4801 }
4802}
4803
4804DISABLE_WARNING_UNREACHABLE_CODE
4805

Callers 1

l_selection_iterateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected