[Ohrrpgce] [ohrrpgce/ohrrpgce] Delaying by X attacks delays by X turns instead when there's also a turn delay (#1118)

Ralph Versteegen notifications at github.com
Sat Apr 25 07:24:39 PDT 2020


I've found that the cause of the bug is here in `pending_attacks_for_this_turn`:
```
 'Check for queued attacks
 FOR i as integer = 0 TO UBOUND(atkq)
  WITH atkq(i)
   'Ignore unused atkq() slots, attacks with a turn delay, and stunned attackers
   IF atkq_attack_active(atkq(i), bslot()) THEN
    '--only blocking queued attacks are considered part of the current
    ' turn (although it is always perfectly possible for a nonblocking
    ' attack to happen in the current turn)
    ' FIXME: Why?! This doesn't look correct - won't it cause us to the next
    ' round even if there are attacks left?
    IF .blocking THEN RETURN YES
   END IF
  END WITH
 NEXT i
```
Replacing `IF .blocking THEN RETURN YES` with `RETURN YES` fixes the problem.
So the bug doesn't happen if the attack is blocking. However there's no way I'm making that change right before release. 

I added that FIXME comment a year and a half ago but because the comment above it so confidently claimed that this was correct I didn't want to change it.

Also in r10640 (d82875bf) I added a comment about attacks (in turn-based mode) getting "shunted" to the next round even if they don't have a turn delay, and fixed another resulting bug. I'm pretty sure I was referring to this behaviour. That fix might need revisiting too.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/ohrrpgce/ohrrpgce/issues/1118#issuecomment-619387402
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20200425/fd70131b/attachment.html>


More information about the Ohrrpgce mailing list