Cataclysm-BN icon indicating copy to clipboard operation
Cataclysm-BN copied to clipboard

Explosion processing is delayed to end of turn for explode-on-impact ammo

Open Coolthulhu opened this issue 2 years ago • 0 comments

Describe the bug

Explosive ammo doesn't cause immediate explosions, as expected. Rather, the explosions occur only after the turn ends, which can be very confusing at first.

Steps To Reproduce

  1. Spawn USAS 12 and explosive slugs
  2. Debug 10 in all skills, trait "quick"
  3. Load USAS with explosive slugs
  4. Switch to burst fire
  5. Pause (wait till the end of turn)
  6. Fire the gun at some point in space, without aiming
  7. Notice lack of explosions
  8. Pause
  9. Explosions appear now

Expected behavior

Explosions appear immediately, ideally after each shot, but certainly before the player regains control.

Screenshots

No response

Versions and configuration

  • OS: Linux
    • OS Version: Distributor ID: Ubuntu; Description: Ubuntu 20.04.3 LTS; Release: 20.04; Codename: focal;
  • Game Version: 2ac7084292 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en_US]
  • Mods loaded: [ Bright Nights [dda], Magiclysm [magiclysm] ]

Additional context

May be hacked around by calling explosion_queue::execute() more often: after each projectile attack, player action, monster action. The function is gated by deque::empty() check, so it should be very cheap to call often. This may require some measure to prevent two executes being called on the same queue in one call stack.

Coolthulhu avatar Sep 24 '22 07:09 Coolthulhu