mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-05 06:21:57 +00:00
## About The Pull Request Mice running away behaviour wasn't working quite how it was supposed to due to a couple of bugs. First of all, the action was written as if it would `perform` every tick, which it doesn't. This means that the code checking if you had left line of sight didn't function, meaning mobs would continue fleeing you even when they couldn't see you any more. Secondly, mobs spent an awful lot of time pathing into walls which was especially noticeable on mice who just would _not_ stop repeatedly squeaking in a way that is kind of funny but gets old when you keep hearing it. Now the pathing stops if it hits a barrier. I'm not... totally fond of this solution because it has a few assumptions baked in (that we want to try and path through doors even if they're dense for one) but I can't for the moment think of a better "path away from" implementation that isn't way more complicated, and this doesn't really need to be complicated. For good measure I noticed a couple of other actions weren't passing a `source_atom` into `is_blocked_turf` so rats were potentially attacking "obstacles" they could simply walk over. Additionally a couple of places were setting `controller.movement_target` directly instead of using the helper method which has a minor risk of runtiming under certain conditions. ## Why It's Good For The Game Mice will stop constantly screaming if they can see someone, and should repath once they have a different escape route more quickly rather than dedicating themselves to trying to burrow through an iron wall. Rats won't bite at tables and racks they can just climb over. ## Changelog 🆑 fix: Mice won't try to path through walls to escape from sight and constantly squeak. fix: Mice will stop running away from you if they can't see you any more. fix: Rats won't bite racks and tables while passing over them. /🆑