Check for valid coord in obj_nexto_xy

This commit is contained in:
Pasi Kallinen
2015-04-29 17:04:49 +03:00
parent b8cfa9b33f
commit 0d3c858452

View File

@@ -2194,7 +2194,7 @@ unsigned oid;
for (fx = ex; abs(fx - ex) < 3; fx += dx) {
for (fy = ey; abs(fy - ey) < 3; fy += dy) {
/* 0, 0 was checked above */
if (fx != x || fy != y) {
if (isok(fx,fy) && (fx != x || fy != y)) {
if ((otmp = sobj_at(otyp, fx, fy)) != 0) {
return otmp;
}