1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-04-14 20:40:45 +01:00

Fix other array-out-of-bounds in projectile code

h/t Noisytoot
This commit is contained in:
chrisANG 2024-05-16 12:35:17 -04:00
parent 982d3e8de1
commit 57789fff30

View file

@ -466,7 +466,8 @@ boolean impaired; /* TRUE if throwing/firing slipped OR magr is confused/stun
}
/* space ahead has iron bars and no monster */
/* 1/5 chance for 'small' objects (see hits_bars), unless if launched from right beside the iron bars */
if (levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS &&
if (isok(bhitpos.x + dx, bhitpos.y + dy) &&
levl[bhitpos.x + dx][bhitpos.y + dy].typ == IRONBARS &&
!m_at(bhitpos.x + dx, bhitpos.y + dy) &&
hits_bars(
/* object fired */ thrownobj_p,