fix: monsters ignore mechs that aren't being piloted #4083
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
This sets it so monsters will ignore mechs that aren't currently being ridden.
Fixes #4030
Describe the solution
In monster.cpp, changed
monster::attitude_to
so that, when checking the attitude towards a fellow monster, monsters with theRIDEABLE_MECH
flag are treated as neutral if they currently also lack theridden
effect.This allows them to still figure out the mech is moving around and acting sus when being ridden if the player is somehow undetectable at the moment (or more amusing and actually-applicable-to-normal-gameplay example, allowing zombies to assume the furniture has abruptly decided to stand up and kidnap their friendly neighborhood player feral).
Describe alternatives you've considered
screm
Testing
Additional context
Ideally zeds would still take a swing at a mech when pathing, same as how they'll bash furniture when pathing, but only real way to do that is to add
ATTACKMON
and that tends to cause bonus dumb behavior like slapping actual friendlies aside, and in general has a very heavy stink of "barely-used remnant of code from before monster infighting through factions was in the game" to it.Checklist