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

Function display_polearm_positions

src/apply.c:3333–3353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3331}
3332
3333staticfn void
3334display_polearm_positions(boolean on_off)
3335{
3336 coordxy x, y, dx, dy;
3337
3338 if (on_off) {
3339 /* on */
3340 tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
3341 for (dx = -3; dx <= 3; dx++)
3342 for (dy = -3; dy <= 3; dy++) {
3343 x = dx + (int) u.ux;
3344 y = dy + (int) u.uy;
3345 if (get_valid_polearm_position(x, y)) {
3346 tmp_at(x, y);
3347 }
3348 }
3349 } else {
3350 /* off */
3351 tmp_at(DISP_END, 0);
3352 }
3353}
3354
3355/*
3356 * Calculate allowable range (pole's reach is always 2 steps):

Callers

nothing calls this directly

Calls 2

tmp_atFunction · 0.85

Tested by

no test coverage detected