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

Function deferred_goto

src/do.c:2074–2104  ·  view source on GitHub ↗

handle something like portal ejection */

Source from the content-addressed store, hash-verified

2072
2073/* handle something like portal ejection */
2074void
2075deferred_goto(void)
2076{
2077 if (!on_level(&u.uz, &u.utolev)) {
2078 d_level dest, oldlev;
2079 int typmask = u.utotype; /* save it; goto_level zeroes u.utotype */
2080
2081 assign_level(&dest, &u.utolev);
2082 assign_level(&oldlev, &u.uz);
2083 if (gd.dfr_pre_msg)
2084 pline1(gd.dfr_pre_msg);
2085 goto_level(&dest, !!(typmask & UTOTYPE_ATSTAIRS),
2086 !!(typmask & UTOTYPE_FALLING),
2087 !!(typmask & UTOTYPE_PORTAL));
2088 if (typmask & UTOTYPE_RMPORTAL) { /* remove portal */
2089 struct trap *t = t_at(u.ux, u.uy);
2090
2091 if (t) {
2092 deltrap(t);
2093 newsym(u.ux, u.uy);
2094 }
2095 }
2096 if (gd.dfr_post_msg && !on_level(&u.uz, &oldlev))
2097 pline1(gd.dfr_post_msg);
2098 }
2099 u.utotype = UTOTYPE_NONE; /* our caller keys off of this */
2100 if (gd.dfr_pre_msg)
2101 free((genericptr_t) gd.dfr_pre_msg), gd.dfr_pre_msg = 0;
2102 if (gd.dfr_post_msg)
2103 free((genericptr_t) gd.dfr_post_msg), gd.dfr_post_msg = 0;
2104}
2105
2106/*
2107 * Return TRUE if we created a monster for the corpse. If successful, the

Callers 4

allmain.cFile · 0.85
maybe_do_tutorialFunction · 0.85
level_teleFunction · 0.85
movemonFunction · 0.85

Calls 6

on_levelFunction · 0.85
assign_levelFunction · 0.85
goto_levelFunction · 0.85
t_atFunction · 0.85
deltrapFunction · 0.85
newsymFunction · 0.85

Tested by

no test coverage detected