Guard the group-loot division by zero #1

Merged
yrtria merged 1 commit from fix/group-zero-guard into main 2026-09-03 11:21:54 -06:00

1 commit

Author SHA1 Message Date
Claude
d114e665be
fix: guard the group-loot division by zero
OnLootMoney counts group members within loot reward distance, then divides
gold by that count with no guard. If no member passes the distance check the
count stays 0 and the division raises SIGFPE, taking worldserver down. The
looter normally counts themselves so this is a latent rather than live bug,
but the guard is free.

Also hoists the LootMultiplier check above the member loop, which skips the
whole walk when the module is configured off, and drops the now-redundant
second test in the solo branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019vTNrJGsprcjdjjjDJD5ZM
2026-09-03 17:21:13 +00:00