[taken out of rescham() in order to be shared by restore_cham()] */
| 4428 | |
| 4429 | /* [taken out of rescham() in order to be shared by restore_cham()] */ |
| 4430 | void |
| 4431 | normal_shape(struct monst *mon) |
| 4432 | { |
| 4433 | int mcham = (int) mon->cham; |
| 4434 | |
| 4435 | if (ismnum(mcham)) { |
| 4436 | unsigned mcan = mon->mcan; |
| 4437 | |
| 4438 | (void) newcham(mon, &mons[mcham], NC_SHOW_MSG); |
| 4439 | mon->cham = NON_PM; |
| 4440 | /* newcham() may uncancel a polymorphing monster; override that */ |
| 4441 | if (mcan) |
| 4442 | mon->mcan = 1; |
| 4443 | newsym(mon->mx, mon->my); |
| 4444 | } |
| 4445 | if (is_were(mon->data) && mon->data->mlet != S_HUMAN) { |
| 4446 | new_were(mon); |
| 4447 | } |
| 4448 | if (M_AP_TYPE(mon) != M_AP_NOTHING) { |
| 4449 | /* this used to include a cansee() check but Protection_from_ |
| 4450 | _shape_changers shouldn't be trumped by being unseen */ |
| 4451 | if (!mon->meating) { |
| 4452 | /* make revealed mimic fall asleep in lieu of shape change */ |
| 4453 | if (M_AP_TYPE(mon) != M_AP_MONSTER) |
| 4454 | mon->msleeping = 1; |
| 4455 | seemimic(mon); |
| 4456 | } else { |
| 4457 | /* quickmimic: pet is midst of eating a mimic corpse; |
| 4458 | this terminates the meal early */ |
| 4459 | finish_meating(mon); |
| 4460 | } |
| 4461 | } |
| 4462 | } |
| 4463 | |
| 4464 | /* freed by freedynamicdata() when game ends; doesn't need to be struct g */ |
| 4465 | static struct monst **itermonarr = NULL; |
no test coverage detected