make monster mtmp next to you (if possible); might place monst on far side of a wall or boulder */
| 3952 | /* make monster mtmp next to you (if possible); |
| 3953 | might place monst on far side of a wall or boulder */ |
| 3954 | void |
| 3955 | mnexto(struct monst *mtmp, unsigned int rlocflags) |
| 3956 | { |
| 3957 | coord mm; |
| 3958 | |
| 3959 | if (mtmp == u.usteed) { |
| 3960 | /* Keep your steed in sync with you instead */ |
| 3961 | mtmp->mx = u.ux; |
| 3962 | mtmp->my = u.uy; |
| 3963 | return; |
| 3964 | } |
| 3965 | |
| 3966 | if (!enexto(&mm, u.ux, u.uy, mtmp->data) || !isok(mm.x, mm.y)) { |
| 3967 | deal_with_overcrowding(mtmp); |
| 3968 | return; |
| 3969 | } |
| 3970 | /* wizard-mode player can choose destination by setting 'montelecontrol' |
| 3971 | option; enexto()'s value for 'mm' will be the default; 'savemm' is |
| 3972 | used to make sure player doesn't choose hero's location and then |
| 3973 | answer 'y' to the 'override invalid spot' prompt */ |
| 3974 | if (iflags.mon_telecontrol) { |
| 3975 | coord savemm = mm; |
| 3976 | |
| 3977 | if (!control_mon_tele(mtmp, &mm, rlocflags, FALSE)) |
| 3978 | mm = savemm; |
| 3979 | } |
| 3980 | |
| 3981 | rloc_to_flag(mtmp, mm.x, mm.y, rlocflags); |
| 3982 | return; |
| 3983 | } |
| 3984 | |
| 3985 | void |
| 3986 | deal_with_overcrowding(struct monst *mtmp) |
no test coverage detected