From d0d7765d2d34d095779f64c8bd62189cb07fafb4 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 18 Jan 2023 09:58:01 -0500 Subject: [PATCH] Fix monsters above 255 being unsummonable Thanks to @fosnola for the fix. --- src/game/boe.monster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/boe.monster.cpp b/src/game/boe.monster.cpp index 5026fa01..cfc579ed 100644 --- a/src/game/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -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; }