VM abort: A_SkelFist

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: VM abort: A_SkelFist

Re: VM abort: A_SkelFist

by 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 all

XDeath:
		"####" "#" 0  //loot drop
		{
			D4SetupLoot(true);
		}
		Goto XDeathNoDrops;

Re: VM abort: A_SkelFist

by 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.)

Re: VM abort: A_SkelFist

by 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.

Re: VM abort: A_SkelFist

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

Alright, but is my xdeaths otherwise acceptable?

Re: VM abort: A_SkelFist

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

The error as described can only happen if DamageMobj destroys the target.

Re: VM abort: A_SkelFist

by 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 all

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.

Re: VM abort: A_SkelFist

by 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.

VM abort: A_SkelFist

by 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.

Top