fix #K3627 - impossible placing long worm at <0,0>
When migrating, a long worm is removed from the map to take off the tail, then its head is put back to be treated like other monsters. If that occurred when being forced to re-migrate during failure to arrive from a prior migration, it wouldn't have valid coordinates and the place_monster attempt produced an impossible warning. (Other types of monsters don't get removed and put back so didn't trigger the problem.) The routine to format a monster when the data is suspect mistakenly thought it was dealing with a long worm tail because the monster didn't match level.monsters[0][0], so the warning inaccurately reported the problem as "placing long worm tail".
This commit is contained in:
@@ -2186,7 +2186,7 @@ minimal_monnam(struct monst *mon, boolean ckloc)
|
||||
Sprintf(outbuf, "[Invalid mon->data %s >= %s]",
|
||||
fmt_ptr((genericptr_t) mon->data),
|
||||
fmt_ptr((genericptr_t) &mons[NUMMONS]));
|
||||
} else if (ckloc && ptr == &mons[PM_LONG_WORM]
|
||||
} else if (ckloc && ptr == &mons[PM_LONG_WORM] && mon->mx
|
||||
&& g.level.monsters[mon->mx][mon->my] != mon) {
|
||||
Sprintf(outbuf, "%s <%d,%d>",
|
||||
pmname(&mons[PM_LONG_WORM_TAIL], Mgender(mon)),
|
||||
|
||||
Reference in New Issue
Block a user