Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Fix the infinite loop of trying to spawn a blacklisted monster

Open cknight828 opened this issue 1 year ago • 7 comments

Summary

None

Purpose of change

Fix #75212

When trying to spawn monsters from a monster group, the quantity of monster to be spawn is not decreased when a sub group of top level monster group is selected, because it should be decreased in the sub group. But if some monsters are blacklisted and they are selected in the sub group, they are replaced with the default monster of the top level group but the quantity is not decreased. For this, extra monsters may be spawn but it normally does not cause serious problems, because the valid monster in the sub group or the individual monster entry of the top level group is selected eventually in the loop. But at the worst case, the top level group contains only monster groups and all monsters in the group are blacklisted (like GROUP_VANILLA with Only Wildlife), the game will freeze.

Describe the solution

The quantity of monster is decreased when a sub group is selected but a blacklisted monster is seleceted in it.

Describe alternatives you've considered

Testing

Start game with Only Wildlife mod and reach FEMA camp.

Additional context

cknight828 avatar Oct 11 '24 13:10 cknight828