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

Function find_drawbridge

src/dbridge.c:179–205  ·  view source on GitHub ↗

* Return true with x,y pointing to the drawbridge if x,y initially indicate * a drawbridge or drawbridge wall. */

Source from the content-addressed store, hash-verified

177 * a drawbridge or drawbridge wall.
178 */
179boolean
180find_drawbridge(coordxy *x, coordxy *y)
181{
182 int dir;
183
184 if (IS_DRAWBRIDGE(levl[*x][*y].typ))
185 return TRUE;
186 dir = is_drawbridge_wall(*x, *y);
187 if (dir >= 0) {
188 switch (dir) {
189 case DB_NORTH:
190 (*y)++;
191 break;
192 case DB_SOUTH:
193 (*y)--;
194 break;
195 case DB_EAST:
196 (*x)--;
197 break;
198 case DB_WEST:
199 (*x)++;
200 break;
201 }
202 return TRUE;
203 }
204 return FALSE;
205}
206
207/*
208 * Find the drawbridge wall associated with a drawbridge.

Callers 10

openoneFunction · 0.85
furniture_handledFunction · 0.85
digholeFunction · 0.85
do_play_instrumentFunction · 0.85
blow_up_landmineFunction · 0.85
zap_updownFunction · 0.85
zap_mapFunction · 0.85
kick_ouchFunction · 0.85
mbhitFunction · 0.85
do_entityFunction · 0.85

Calls 1

is_drawbridge_wallFunction · 0.85

Tested by

no test coverage detected