Skip to content
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

DOS/QB: Battles crash when attacking. #152

Closed
ohrrpgce-bugbot opened this issue Feb 23, 2006 · 3 comments
Closed

DOS/QB: Battles crash when attacking. #152

ohrrpgce-bugbot opened this issue Feb 23, 2006 · 3 comments
Labels
battles Not specifically an attack bug/feature bug Yeah... that's broken crash Bugs causing a crash, freeze/hang, abort(), or FB fatal error os: dos Specific to the DOS versions rel: tirgoviste Present in tirgoviste 2006-03-15

Comments

@ohrrpgce-bugbot
Copy link

[bz#152]

The DOS version, game-qb.exe currently crashes in battle whenever a hero or
enemy attacks. The crash reports "Subscript out of range"

The crash occurs after the attack animation is complete (or at least nearly
complete) and I have verified that it happens sometime after inflict is called.

From: @bob-the-hamster
Reported version: 20060315 Tirgoviste
Operating system: MS-DOS

@ohrrpgce-bugbot
Copy link
Author

Comment author: @bob-the-hamster

I have narrowed this one down to somewhere inside the "ifdead" gosub block in
bmod.bas, but due to need for sleep, I shall not be hunting it any further tonight

@ohrrpgce-bugbot
Copy link
Author

Comment author: @bob-the-hamster

I found it. This line:

IF stat(deadguy, 0, 0) = 0 AND a((deadguy - 4) * 4) > 0 THEN

In ifdead. The problem is accessing a((deadguy - 4) * 4) when deadguy = 0 (that
is to say, when this gosub is called for heroes). The problem was introduced as
part of the fix for bug bz⁠#142. The reason it did not crash the Windows version is
because we currently have array-bounds-checking turned off (we really gotta get
that turned on)

I'm still thinking about what is the correct fix without bringing back bug bz⁠#142

@ohrrpgce-bugbot
Copy link
Author

Comment author: @bob-the-hamster

Problem solved, tested.
This part of the code deserves a lot more cleanup, but that can happen later.

marking fixed

@ohrrpgce-bugbot ohrrpgce-bugbot added battles Not specifically an attack bug/feature bug Yeah... that's broken os: dos Specific to the DOS versions crash Bugs causing a crash, freeze/hang, abort(), or FB fatal error rel: tirgoviste Present in tirgoviste 2006-03-15 labels Mar 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
battles Not specifically an attack bug/feature bug Yeah... that's broken crash Bugs causing a crash, freeze/hang, abort(), or FB fatal error os: dos Specific to the DOS versions rel: tirgoviste Present in tirgoviste 2006-03-15
Projects
None yet
Development

No branches or pull requests

1 participant