cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
695 stars 273 forks source link

Friendly monsters don't fight back against enemies if you're adjacent to them #4206

Open chaosvolt opened 9 months ago

chaosvolt commented 9 months ago

Describe the bug

Exactly what it says on the tin. I just happened to notice that a summon glyph I was using was sitting there and ignoring enemies that were actively slapping it around, and soon found the odd behavior kicked in when I was standing next to it. After testing I soon found vanilla monsters do this too, it isn't just a result of the PRIORITIZE_TARGETS flag nor is it from the monster counting as a pet.

Steps To Reproduce

  1. Spawn in and successfully activate an inactive manhack.
  2. Box it in so it's forced to hover next to you.
  3. Summon a zombie next to it.
  4. Wait, observe the manhack takes the beating without retaliating.
  5. Step away from the manhack and watch as it finally remembers it is a spicy lil robot covered in knives.

Screenshots

image

Versions and configuration

Additional context

No response

chaosvolt commented 9 months ago

New discovery: image image

It seems to be related to the HIT_AND_RUN flag, but with the added complication that removing the flag via copy-from doesn't seem to work right for the sake of this bug. The monster I first encountered this bug with, summoned hunting horrors in Arcana, inherits from a HIT_AND_RUN monster but deletes the flag: https://github.com/chaosvolt/cdda-arcana-mod/blob/master/Arcana_BN/monsters/monsters.json#L587

I can confirm that summoned hunting horrors don't actually exihibit hit-and-run behavior however so it SHOULD be getting deleted properly.