Guard the group-loot division by zero #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/group-zero-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Upstream compiles clean against AzerothCore
efe123fab(2026-08-14). It uses the pre-2024 single-argument script constructors, which still work --PlayerScript::PlayerScriptexplicitly enables all hooks when the hook list is empty -- andOnLootMoney,OnPlayerCompleteQuestandOnAfterConfigLoadall still match their base signatures.Change
OnLootMoneycounts group members within loot reward distance, then doesgold / membersInRangewith no guard. A group where no member passes the distance check divides by zero and raises SIGFPE, taking worldserver down. The looter normally counts themselves, so this is latent rather than live -- but the guard costs nothing.Also hoists the
LootMultiplier < 1check above the member loop (skips the walk entirely when the module is configured off) and drops the now-redundant second test in the solo branch.Verification
clang++ -fsyntax-onlyagainst the live build's own flags: clean. Not built or run.Note, not a code issue
This fires
Guild::HandleMemberDepositMoney-- a DB write plus a bank log row -- on every money loot and every quest turn-in, including bots. With 22 guilds and 314 guild members on this realm, most of them bots, that is real added write load on a VM tuned for playerbot load. Worth watching after the build rather than changing here.