Fix monsters above 255 being unsummonable

Thanks to @fosnola for the fix.
This commit is contained in:
2023-01-18 09:58:01 -05:00
parent 3c246c7df5
commit d0d7765d2d

View File

@@ -1187,7 +1187,8 @@ void activate_monsters(short code,short /*attitude*/) {
mon_num_t get_summon_monster(short summon_class) {
for(short i = 0; i < 200; i++) {
short j = get_ran(1,0,255);
// this assumes that there is at least one monster
short j = get_ran(1,0,univ.scenario.scen_monsters.size()-1);
if(univ.scenario.scen_monsters[j].summon_type == summon_class) {
return j;
}