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

Function doride

src/steed.c:177–193  ·  view source on GitHub ↗

the #ride command */

Source from the content-addressed store, hash-verified

175
176/* the #ride command */
177int
178doride(void)
179{
180 boolean forcemount = FALSE;
181
182 if (u.usteed) {
183 dismount_steed(DISMOUNT_BYCHOICE);
184 } else if (getdir((char *) 0) && isok(u.ux + u.dx, u.uy + u.dy)) {
185 if (wizard && y_n("Force the mount to succeed?") == 'y')
186 forcemount = TRUE;
187 return (mount_steed(m_at(u.ux + u.dx, u.uy + u.dy), forcemount)
188 ? ECMD_TIME : ECMD_OK);
189 } else {
190 return ECMD_CANCEL;
191 }
192 return ECMD_TIME;
193}
194
195/* Start riding, with the given monster */
196boolean

Callers

nothing calls this directly

Calls 4

dismount_steedFunction · 0.85
getdirFunction · 0.85
isokFunction · 0.85
mount_steedFunction · 0.85

Tested by

no test coverage detected