1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00

fixed a crash when setting custom land difficulty to 0

This commit is contained in:
Zeno Rogue 2024-07-27 20:44:04 +02:00
parent 39b112acab
commit eb9eac7318

View File

@ -181,7 +181,9 @@ EX int hrand_monster_in(eLand l, int x) {
if(t > 500) x = int(((long long)(x)) * t / 500);
}
if(use_custom_land_list) {
x = x * 100 / custom_land_difficulty[l];
auto diff = custom_land_difficulty[l];
if(!diff) return 1000000000;
x = x * 100 / diff;
if(x == 0) x = 1;
}
return hrand(x);