-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make friendly monsters follow you unless under attack #50864
Conversation
It was suggested during code review that I could also fix #50532 with a couple more lines of code. |
5a2d5fa
to
78a69fd
Compare
I also spawned a zombie to see what the friendly dog would do. It stopped following me, but did not attack the zombie. Note that non-friendly dogs do fight back, after taking enough damage (though at that point they'll attack anything). It's friendly dogs that are broken. |
I don't understand the code, but on a surface level this looks like the right way to fix this issue. Leashing is in the game, it requires a short rope. That was the intended way to move animals like cows way back when cows were added |
@LyleSY: what makes you say that leashing is in the game? It would be great it that were true, but I can't find it either in the UI or in All I could find was an old suggestion (#10256) which was closed as stale. Edit: The leashing PR is ready: #50890. I suppose whether or not leashing was in the game before is no longer relevant. |
Ah, I was remembering talking to @AlecWhite about this (ugh) four years ago https://www.reddit.com/r/cataclysmdda/comments/6shimz/so_cows_now_have_new_functionality/ Alec had a PR to do it but it looks like it was never merged. Sorry for the confusion, good stuff! |
Would it be possible to add logic preventing tamed animals from entering moving vehicles, maybe follow a few spaces away instead? I am running the latest experimental and with the "crazy cat lady" session I have going on her pets swarm when it is safe and she is close, that swarm becomes a hazard when driving. |
Summary
Bugfixes "Make friendly monsters follow you unless under attack"
Purpose of change
Currently tamed animals will not follow you if they can see other untamed animals. I believe this is due to code in
monster::plan()
intended to target (and probably attack) potential threats. However, when there are neutral animals around that just shifts the target away from the PC (who they would otherwise follow).Describe the solution
Change the relevant code to only target hostile monsters.
Describe alternatives you've considered
Testing
Spawn some dog food and 2 dogs. Feed one dog and move away. The friendly dog won't follow you without this change as long as it can see the other dog. After making this change it does follow you.
Additional context
Before: friendly dog not following because it sees the other dog.
After: friendly dog following.