initialize attknum

`attknum` is declared without initialization, and is used on
find_roll_to_hit().  This leads unexpected result.
This commit is contained in:
SHIRAKATA Kentaro
2021-10-21 21:17:36 +09:00
committed by nhmall
parent 0f36d7ac6e
commit 1f651f8f00

View File

@@ -580,7 +580,7 @@ hitum_cleave(struct monst *target, /* non-Null; forcefight at nothing doesn't
*/
for (count = 3; count > 0; --count) {
struct monst *mtmp;
int tx, ty, tmp, dieroll, mhit, attknum, armorpenalty;
int tx, ty, tmp, dieroll, mhit, attknum = 0, armorpenalty;
/* ++i, wrap 8 to i=0 /or/ --i, wrap -1 to i=7 */
i = clockwise ? DIR_RIGHT(i) : DIR_LEFT(i);