register struct obj *otmp;
int x, y;
{
- register struct obj *otmp2 = level.objects[x][y];
+ register struct obj *otmp2 = g.level.objects[x][y];
+ if (!isok(x, y)) { /* validate location */
+ void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2);
+
+ func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
+ : impossible;
+ (*func)("place_object: \"%s\" [%d] off map <%d,%d>",
+ safe_typename(otmp->otyp), otmp->where, x, y);
+ }
if (otmp->where != OBJ_FREE)
- panic("place_object: obj not free");
+ panic("place_object: obj \"%s\" [%d] not free",
+ safe_typename(otmp->otyp), otmp->where);
obj_no_longer_held(otmp);
if (otmp->otyp == BOULDER) {
if (In_endgame(&u.uz)) {
m1 = m2 = m3 = m4 = m5 = zm = (struct monst *) 0;
- if (!msgmv || (moves - msgmv) > 200L) {
+ if (!msgmv || (g.moves - msgmv) > 200L) {
if (!msgmv || rn2(2))
- You("feel besieged.");
+ You_feel("besieged.");
- msgmv = moves;
+ msgmv = g.moves;
}
/*
* m1 an elemental from another plane.