[Fixed] VM abort: A_SkelFist

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

VM abort: A_SkelFist

Postby Major Cooke » Mon Jun 05, 2017 7:02 pm

https://puu.sh/wc4Hg/22e6206a5b.png

It appears that change with the self check is still causing some issues.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: VM abort: A_SkelFist

Postby Graf Zahl » Tue Jun 06, 2017 12:38 am

Crap. The check is ok. What is not ok is that the previous call to target.DamageMobj can result in target becoming destroyed. The added check only revealed a much deeper and more serious logical error: It is absolutely unacceptable that damaging an object can result in an actor becoming immediately invalid, there needs to be a short delay so that subsequent operations on the killed actor still work.

While I cannot prevent this I have to issue a warning here: DO NOT USE 0-LENGTH DEATH STATES! They may cause problems in places you never expect if you are not extremely careful with checking if a DamageMobj call resulted in a kill. Always let it end in a waiting state. A simple 'goto null' instead of 'stop' is enough.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: VM abort: A_SkelFist

Postby Major Cooke » Tue Jun 06, 2017 5:18 am

All monsters in D4D have a 1 tic delay before their disappearance. You can check their xdeaths yourself if you want.

Code: Select allExpand view
XDeathNoDrops:   
      TNT1 A 1
      {
         bThruActors = true;
         XDeathGush();
         D4DropItems();
         D4DropCash(CashMultiplier,CashDropper); //"ArachnoCashGiver");
         A_KillMaster("Massacre",KILS_FOILINVUL,null,"D4DSpawner");
         A_NoBlocking();   //just in case
         
         if (RuneChance(RuneChance_Arach))
         {   A_SpawnItemEx("ArachnotronRune",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION); }
      }
      
      Stop;


So that's not the issue with D4D's monsters.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: VM abort: A_SkelFist

Postby Graf Zahl » Tue Jun 06, 2017 5:47 am

The error as described can only happen if DamageMobj destroys the target.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: VM abort: A_SkelFist

Postby Major Cooke » Tue Jun 06, 2017 6:50 am

Alright, but is my xdeaths otherwise acceptable?
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: VM abort: A_SkelFist

Postby Graf Zahl » Tue Jun 06, 2017 7:42 am

Hard to tell, it calls lots of functions. You always have to be aware that they all get executed upon the 'SetState('Death') call inside DamageMobj so any of them may pull away the rug under the calling function.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: VM abort: A_SkelFist

Postby Gez » Tue Jun 06, 2017 8:28 am

Better put another TNT1 A 1 state in between.

(Kind of funny that "XDeathNoDrops" calls two Drop functions.)
Gez
 
 
 
Joined: 06 Jul 2007

Re: VM abort: A_SkelFist

Postby Major Cooke » Tue Jun 06, 2017 9:35 am

Graf Zahl wrote:Hard to tell, it calls lots of functions. You always have to be aware that they all get executed upon the 'SetState('Death') call inside DamageMobj so any of them may pull away the rug under the calling function.


Gez wrote:(Kind of funny that "XDeathNoDrops" calls two Drop functions.)


Most of those will be going away in the next update as I move the entirety of the pinata drops and cash giving to the event handler. This will allow non-D4D monsters to participate without needing replacements.

Those drop functions just mean "drop whatever you've accumulated" which the accumulation is performed before that state itself.

Code: Select allExpand view
XDeath:
      "####" "#" 0  //loot drop
      {
         D4SetupLoot(true);
      }
      Goto XDeathNoDrops;
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest