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:
parent
39b112acab
commit
eb9eac7318
@ -181,7 +181,9 @@ EX int hrand_monster_in(eLand l, int x) {
|
|||||||
if(t > 500) x = int(((long long)(x)) * t / 500);
|
if(t > 500) x = int(((long long)(x)) * t / 500);
|
||||||
}
|
}
|
||||||
if(use_custom_land_list) {
|
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;
|
if(x == 0) x = 1;
|
||||||
}
|
}
|
||||||
return hrand(x);
|
return hrand(x);
|
||||||
|
Loading…
Reference in New Issue
Block a user