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

Function restore_cham

src/mon.c:4648–4658  ·  view source on GitHub ↗

called when restoring a monster from a saved level; protection against shape-changing might be different now than it was at the time the level was saved. */

Source from the content-addressed store, hash-verified

4646 against shape-changing might be different now than it was at the
4647 time the level was saved. */
4648void
4649restore_cham(struct monst *mon)
4650{
4651 if (Protection_from_shape_changers || mon->mcan) {
4652 /* force chameleon or mimic to revert to its natural shape */
4653 normal_shape(mon);
4654 } else if (mon->cham == NON_PM) {
4655 /* chameleon doesn't change shape here, just gets allowed to do so */
4656 mon->cham = pm_to_cham(monsndx(mon->data));
4657 }
4658}
4659
4660/* unwatched hiders may hide again; if so, returns True */
4661staticfn boolean

Callers 3

getlevFunction · 0.85
mon_arriveFunction · 0.85
montraitsFunction · 0.85

Calls 2

normal_shapeFunction · 0.85
pm_to_chamFunction · 0.85

Tested by

no test coverage detected