Prevent boomerang going out of map

This commit is contained in:
Pasi Kallinen
2024-05-01 10:12:51 +03:00
parent 6ebc3a7291
commit 575d8c0696

View File

@@ -4089,6 +4089,11 @@ boomhit(struct obj *obj, coordxy dx, coordxy dy)
dy = ydir[i];
gb.bhitpos.x += dx;
gb.bhitpos.y += dy;
if (!isok(gb.bhitpos.x, gb.bhitpos.y)) {
gb.bhitpos.x -= dx;
gb.bhitpos.y -= dy;
break;
}
if ((mtmp = m_at(gb.bhitpos.x, gb.bhitpos.y)) != 0) {
m_respond(mtmp);
tmp_at(DISP_END, 0);