1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-07 15:55:29 +01:00

Bugfix: undefined behaviour in make_horror

shift exponent 32 too large for 32-bit type
This commit is contained in:
Ron Nazarov 2024-05-15 23:51:50 +01:00 committed by ChrisANG
parent c698456e62
commit f06ee2082e

View file

@ -2001,22 +2001,22 @@ int level_bonus;
horror->mflagsv = 0;
for (i = 0; i < rnd(17); i++) {
horror->mflagsm |= (1 << rn2(33)); /* trainwreck this way :D */
horror->mflagsm |= (1L << rn2(33)); /* trainwreck this way :D */
}
for (i = 0; i < rnd(17); i++) {
horror->mflagst |= (1 << rn2(33));
horror->mflagst |= (1L << rn2(33));
}
for (i = 0; i < rnd(17); i++) {
horror->mflagsb |= (1 << rn2(33));
horror->mflagsb |= (1L << rn2(33));
}
for (i = 0; i < rnd(17); i++) {
horror->mflagsg |= (1 << rn2(33));
horror->mflagsg |= (1L << rn2(33));
}
for (i = 0; i < rnd(17); i++) {
horror->mflagsa |= (1 << rn2(33));
horror->mflagsa |= (1L << rn2(33));
}
for (i = 0; i < rnd(17); i++) {
horror->mflagsv |= (1 << rn2(33));
horror->mflagsv |= (1L << rn2(33));
}
// horror->mflagsb &= ~MB_UNSOLID; /* no ghosts */