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

Function dotravel_target

src/cmd.c:5347–5377  ·  view source on GitHub ↗

#retravel, travel to iflags.travelcc, which must be set */

Source from the content-addressed store, hash-verified

5345
5346/* #retravel, travel to iflags.travelcc, which must be set */
5347staticfn int
5348dotravel_target(void)
5349{
5350 if (!isok(iflags.travelcc.x, iflags.travelcc.y)) {
5351 /* assume <0,0>, the value assigned when travel reaches destination */
5352 pline("No travel destination set.");
5353 return ECMD_OK;
5354 } else if (u_at(iflags.travelcc.x, iflags.travelcc.y)) {
5355 /* maybe interrupted while traveling then just walked rest of way
5356 so destination hasn't been reset yet */
5357 You("are already here.");
5358 iflags.travelcc.x = iflags.travelcc.y = 0;
5359 return ECMD_OK;
5360 }
5361
5362 iflags.getloc_travelmode = FALSE;
5363
5364 svc.context.travel = 1;
5365 svc.context.travel1 = 1;
5366 svc.context.run = 8;
5367 svc.context.nopick = 1;
5368 gd.domove_attempting |= DOMOVE_RUSH;
5369
5370 if (!gm.multi)
5371 gm.multi = max(COLNO, ROWNO);
5372 u.last_str_turn = 0;
5373 svc.context.mv = TRUE;
5374
5375 domove();
5376 return ECMD_TIME;
5377}
5378
5379/* mouse click look command */
5380staticfn int

Callers 1

dotravelFunction · 0.85

Calls 4

isokFunction · 0.85
YouFunction · 0.85
domoveFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected