MCPcopy Index your code
hub / github.com/NetHack/NetHack / avoid_moving_on_trap

Function avoid_moving_on_trap

src/hack.c:2443–2460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2441}
2442
2443staticfn boolean
2444avoid_moving_on_trap(coordxy x, coordxy y, boolean msg)
2445{
2446 struct trap *trap;
2447
2448 if ((trap = t_at(x, y)) && trap->tseen
2449 /* the vibrating square is implemented as a trap but treated as if
2450 it were a type of terrain */
2451 && trap->ttyp != VIBRATING_SQUARE) {
2452 if (msg && flags.mention_walls) {
2453 set_msg_xy(x, y);
2454 You("stop in front of %s.",
2455 an(trapname(trap->ttyp, FALSE)));
2456 }
2457 return TRUE;
2458 }
2459 return FALSE;
2460}
2461
2462staticfn boolean
2463avoid_moving_on_liquid(

Callers 2

lookaroundFunction · 0.85

Calls 5

t_atFunction · 0.85
set_msg_xyFunction · 0.85
YouFunction · 0.85
anFunction · 0.85
trapnameFunction · 0.85

Tested by

no test coverage detected