-
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
Autoattack wont attack things nearby in the lab start. #37904
Comments
Looks like autoattack won't work Reproduce steps (savegame is attached):
|
Yeah, this is deeper than it appears. It also affects cycling targets via tab in the 'f'ire menu, no target is selected. Turrets are frequently detecting creatures on different Z levels and unloading their entire clips into the ceiling or floor. You frequently hear them as you're roaming about aboveground, which is also an issue, albeit separate (in most cases at least). I've been pondering the cause and I'm pretty sure it's due to the autoaim searching Z level 0 (possibly higher) first. I'm not sure exactly in which order Z levels are checked, but I'm pretty certain that any out of sight enemy that would be a valid target if visible on any Z level higher than yourself is the cause of this bug. I'm guessing the aim code cycles from the top and there isn't a check on visibility through floor tiles before returning the target and closing the loop. That or there's a Z level visibility check that was left outside the loop when auto aim across Z levels was introduced. |
The problem is in
map::sees() dosnt seem to be behaving properly, also theres no actual check for barriers between. replacing map::sees() with !find_clear_path.empty() fixes this problem, but seems to still allow the player to attempt to bash through walls with a spear when they press autoattack with a clairvoyance artifact. Ramza13 said they would take it from here later. |
Ah, this might be the reason monsters are "seeing" enemies across Z levels, too. |
Quite possibly, I looked at map::sees() and it had lots of stuff about transparency caches and z-levels in there, it was a bit over my head, but it seems like theres perhaps something misbehaving in there. Ideally I suppose somebody should fix that, but replacing it with another method fixes this bug for now it seems. |
Describe the bug
Pressing auto attack while next to zombies in the lab start wont attack them it just waits.
Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
Autoattack to swing at clearly hostile zombies next to me
Screenshots
Versions and configuration
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food]
]
-->
Additional context
Autoattack works for the first swing after loading, or if you open up the debug menu and close it right away it'll work for a single attack.
This hasnt happened to me yet starting on another scenario type, only in the lab.
The text was updated successfully, but these errors were encountered: