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

Function parkguard

src/vault.c:154–171  ·  view source on GitHub ↗

move guard--dead to alive--to <0,0> until temporary corridor is removed */

Source from the content-addressed store, hash-verified

152
153/* move guard--dead to alive--to <0,0> until temporary corridor is removed */
154staticfn void
155parkguard(struct monst *grd)
156{
157 /* either guard is dead or will now be treated as if so;
158 monster traversal loops should skip it */
159 if (grd == svc.context.polearm.hitmon)
160 svc.context.polearm.hitmon = 0;
161 if (grd->mx) {
162 remove_monster(grd->mx, grd->my);
163 newsym(grd->mx, grd->my);
164 }
165 if (m_at(0, 0) != grd)
166 place_monster(grd, 0, 0);
167 /* [grd->mx,my just got set to 0,0 by place_monster(), so this
168 just sets EGD(grd)->ogx,ogy to 0,0 too; is that what we want?] */
169 EGD(grd)->ogx = grd->mx;
170 EGD(grd)->ogy = grd->my;
171}
172
173/* called in mon.c */
174boolean

Callers 3

grddeadFunction · 0.85
findgdFunction · 0.85
gd_move_cleanupFunction · 0.85

Calls 2

newsymFunction · 0.85
place_monsterFunction · 0.85

Tested by

no test coverage detected