fix: don't allow IMMOBILE
monsters to join hordes
#4205
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of change
In my laptop save I spotted a trapped tendril just chilling in the middle of a lake, having drifted from the nearby office tower due to horde mode behavior.
Describe the solution
In overmap.cpp, changed
overmap::move_hordes
so that the OR function that filters out monsters who should not join hordes also checks for stuff with theIMMOBILE
monster flag. It already excludes monsters with a speed of 30 or less, so monsters that can't move at all are fitting to exclude too.Describe alternatives you've considered
Not playing with wander spawns on and/or not trying to raid aircraft carriers just offshore from collapsed office towers.
Testing
Currently out and about, can compile test when I get back home but don't see any sane way to actually test this other than setting half the monsters in the game to have the
IMMOBILE
flag then agitating the zeds to see what gets horde'd, given how uncommon immobile zeds are.Additional context
Dang ol' floor tentacles growin' legs and waddlin' off I swear
Also a problem in DDA currently: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/overmap.cpp#L4097
Checklist