From acee151bf225437da87395f8b056feb7f24398de Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 21 Apr 2025 10:35:41 -0500 Subject: [PATCH] Fix TODO note about too many wandering monsters --- src/game/boe.main.cpp | 3 ++- src/game/boe.monster.cpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index 3bd742c9..a354da3a 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -110,7 +110,8 @@ std::map> feature_flags = { {"file-picker-dialog", {"V1"}}, {"scenario-meta-format", {"V2"}}, // Bugs required for several VoDT test replays to run faithfully - {"empty-wandering-monster-bug", {"fixed"}} + {"empty-wandering-monster-bug", {"fixed"}}, + {"too-many-extra-wandering-monsters-bug", {"fixed"}} }; struct cParseEntrance { diff --git a/src/game/boe.monster.cpp b/src/game/boe.monster.cpp index 22143be5..f33092c6 100644 --- a/src/game/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -81,6 +81,14 @@ void create_wand_monst() { if(!is_blocked(p_loc)) place_monster(univ.town->wandering[r1].monst[i],p_loc); } + // Buggy behavior of this code, preserved so old replays will run correctly, + // would create more than 1-2 of the last monster type, contradicting the + // documentation. + if(!has_feature_flag("too-many-extra-wandering-monsters-bug", "fixed")){ + try_place_extra_monster(); + } + } + if(has_feature_flag("too-many-extra-wandering-monsters", "fixed")){ try_place_extra_monster(); } }