Page 1 of 1

[fixed]Thrown inventory items causing GZdoom to freeze

Posted: Wed May 24, 2006 23:30
by Enjay
I mentioned this a while back in another thread (which I can't find ATM). At that time, I was having problems with my flare item causing what seemed like random crashes. I messed around with it until it became the version that was released in the Thief WAD. For some reason that didn't seem to cause the problem. However, I have now created another item and it seems to reliably and repeatedly cause what seems like the same/a very similar problem.

Grab the linked file. Load it and pick up the grenade box. Attached to it is a script that simply gives you 25 grenades. GiveInventory ("NJArtiFragGrenade", 25) ). Then walk right up to the door so that you are touching it (as if you were going to open it) but rather than hitting [USE], hit whichever key you have bound to use inventory items to throw a grenade. If it behaves like it does on my system, this will cause GZdoom to get stuck. You can usually Ctrl-Alt-Del to shut GZdoom down, but it can be a pain to do so, and you get stuck with your screen using the game gama settings.

http://www.zen64060.zen.co.uk/gren.zip

[edit]OK, process of elimination stuff by comparing it to my flare...

Reducing the size of the projectile item (NJFragGrenade) to 4x4 and reducing its speed to 20 seems to cure the problem. Restore either thing back to its original value and the problem comes back.[/edit]

Posted: Fri May 26, 2006 18:40
by Enjay
Can I ask what specifically was causing the problem? It's something that has bugged me on and off for some time now, so I'm just curious to know why it happened with some set ups and not others.

Oh, and there are a few fixes you have done recently for things that have been bugging me. Will you be in a position to build a new version any time soon or are you still otherwise commited? (Not pushing, just trying to sort out my own timescale.)

Posted: Fri May 26, 2006 18:50
by Graf Zahl
It was an incorrect use of a global variable in the function that executes the Pickup, Use and Drop states. When your projectile was spawned in the wall its death state got called immediately which contained a code pointer. That overwrote that global variable. Now I am using a local one and all is well.

As for a next version I don't know. ZDoom's code is too much in a state of flux at the moment and there is one outstanding issue that I'd like to see resolved before a release (the player spawn issue in the ZDoom bugs forum.)

Posted: Fri May 26, 2006 19:00
by Enjay
OK, thanks. I was sure it was inventory related somehow because I tried to cause the same problem with weapon spawned projectiles and couldn't. Why did making the projectile smaller work? Was it simply that it was less likely to be spawned in a wall?

Posted: Fri May 26, 2006 21:21
by Graf Zahl
Exactly. When spawned in a wall it always hang the engine.