ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
680 stars 59 forks source link

[BUG] [Blood] UpdateSprite Assertion failure #533

Closed Talon1024 closed 3 years ago

Talon1024 commented 3 years ago

Raze version

Git

What Operating System are you using?

Linux x86_64

Which game are you running with Raze?

Blood

If Other OS, please describe

No response

Relevant hardware info

Intel Ivy Bridge CPU, integrated GPU

Have you checked that no other similar issue already exists?

A clear and concise description of what the bug is.

I have been unable to reproduce it consistently, but it's been happening quite often when I started playing Blood: Cryptic Passage recently, and I found a spot where I can almost reproduce it consistently. See the attached savegame, and change the extension to .dsave.

save0005.zip

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Throw the dynamite at the corpse in the saved game
  2. The game will most likely assert out, but it may not. If it does not, reload the saved game.

Your configuration

I'm using the new renderer

Provide a Log

raze: ../source/games/blood/src/seq.cpp:263: void Blood::UpdateSprite(int, Blood::SEQFRAME*): Assertion `nSprite >= 0 && nSprite < kMaxSprites' failed.
coelckers commented 3 years ago

I cannot find out anymore what has happened, the error is baked into the savegame. What happens is that one animation sequence is attached to a sprite that has already been deleted. All I can do is detect the issue and terminate the animation. With any luck this was related to a bug I found independently a few hours ago, so it is connected it should not happen anymore with newer builds. The savegame will remain bugged, though.

coelckers commented 3 years ago

On closer inspection I think I know what happens. There's an animation attached to the corpse to make it vanish. That animation isn't deleted when you blow it up so it loses its target. I am now catching this case in the animation processing code. Ideally the animation should be deleted when the corpse is blown up but right now I have no idea how to achieve that. Well, at least it won't assert or crash anymore.