View Issue Details

IDProjectCategoryView StatusLast Update
0000015Gameplay + OpenGL[All Projects] Bugpublic2017-01-11 03:19
ReporterLud 
Assigned ToGraf Zahl 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformMicrosoft WindowsOSWindows 10OS Version
Summary0000015: Crash on using kill command combined with A_KillChildren
DescriptionI have a Cyberdemon. It marks a target for bombardment. Beacon is removed on Cyberdemon death. Killing Cyberdemon using normal means works. Killing Cyberdemon using "kill Cyberdemon" causes crash. Crash only happens if I kill Cyberdemon while any beacons are present. Bug report attached.
TagsNo tags attached.

Relationships

Activities

Lud

Lud

2017-01-09 16:59

reporter  

CrashReport.zip (20,883 bytes)
Graf Zahl

Graf Zahl

2017-01-09 17:06

administrator   ~0000004

I need the DECORATE definition that causes the crash.
Lud

Lud

2017-01-09 17:08

reporter   ~0000005

Actor L50CyberdemonBeacon : BulletPuff
{
    var int user_i;

    VSpeed 0

    +PUFFONACTORS
    +BLOODLESSIMPACT
    -BLOODSPLATTER

    States
        {
        Spawn:
            BFGS A 70 NODELAY
            {
                for (user_i = 0; user_i <= 360; user_i += 8)
                {
                    A_SpawnParticle("Red", SPF_RELATIVE | SPF_FULLBRIGHT, 70, 32, user_i, 128, 0, -30, 0, 0, 0, 0, 0, 0, 1.0, 0);
                }
            }
        MainSpawn:
            BFGS A 20
            {
                for (user_i = 0; user_i <= 360; user_i += 8)
                {
                    A_SpawnParticle("Red", SPF_RELATIVE | SPF_FULLBRIGHT, 40, 32, user_i, 128, 0, -30);
                }
                A_SpawnItemEx("L50CyberdemonOrbitalBeam", random(0, 128), 0, ceilingz - 64, 0, 0, -100, random(1, 360));
            }
            Loop
        Crash:
            Stop
        Melee:
            Stop
        }
}

Actor L50EliteCyberdemon : Cyberdemon replaces Cyberdemon
{
    var int user_i;
    var int user_countdown;
    var float user_psize;
    
    Health 5000
    
    Obituary "%o faced the Overlord's wrath."
    
    Translation "48:79=[121,121,121]:[0,0,0]", "1:1=0:0", "128:151=111:111", "208:231=[55,0,1]:[234,0,6]", "161:161=181:181"
    
    States
        {
        See:
            CYBR A 3
            {
                user_countdown--;
                user_psize = 32;
                A_Hoof;
                if (!CountInv("L50ShieldActive")) { A_ChangeFlag("INVULNERABLE", FALSE); }
            }
            CYBR ABBCC 3
            {
                user_countdown--;
                user_psize = 32;
                A_Chase;
                if (!CountInv("L50ShieldActive")) { A_ChangeFlag("INVULNERABLE", FALSE); }
            }
            CYBR D 3
            {
                user_countdown--;
                user_psize = 32;
                A_Metal;
                if (!CountInv("L50ShieldActive")) { A_ChangeFlag("INVULNERABLE", FALSE); }
            }
            CYBR D 3
            {
                user_countdown--;
                user_psize = 32;
                A_Chase;
                if (!CountInv("L50ShieldActive")) { A_ChangeFlag("INVULNERABLE", FALSE); }
            }
            Loop
        Missile:
            CYBR E 0 A_JumpIf(user_countdown <= 0, "OrbitalBombardment")
            CYBR E 1
            {
                user_psize += 0.3;
                A_FaceTarget;
                A_SpawnParticle("Red", SPF_RELATIVE | SPF_FULLBRIGHT, 1, user_psize, 0, 15, -25, 57);
                return A_JumpIf(user_psize >= 64, "Beam");
            }
            Loop
        Beam:
            CYBR F 4 A_SpawnProjectile("L50CyberdemonBeam", 56, -22)
            Goto See
        Pain:
            CYBR G 10
            {
                A_Pain;
                if (A_Jump(128, "Null") && !CountInv("L50ShieldActive"))
                {
                    A_SpawnItemEx("L50CyberdemonShield", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER);
                    A_GiveInventory("L50ShieldActive");
                    A_ChangeFlag("INVULNERABLE", TRUE);
                }
            }
            Goto See
        OrbitalBombardment:
            CYBR E 35
            {
                A_FaceTarget;
                A_SpawnItemEx("L50CyberdemonBeacon", GetDistance(FALSE), 0, CallACS("L50GetTargetZ") + 64, 0, 0, 0, 0, SXF_SETMASTER);
                user_countdown = 64;
            }
            Goto See
        Death:
            TNT1 A 0 A_RemoveChildren(TRUE, RMVF_EVERYTHING)
            Goto Super::Death
        }
}

Not sure if this will appear properly.
Graf Zahl

Graf Zahl

2017-01-09 17:40

administrator   ~0000006

I added a check to avoid the crash. The actual problem is not fixable, though. Your Cyberdemon calls A_RemoveChildren in its death state, which happens to break the thinker chain because the Cyberdemon will destroy the object right after itself in the list.

You should add a one-tic empty state before calling A_RemoveChildren to avoid unexpected behavior.

Issue History

Date Modified Username Field Change
2017-01-09 16:59 Lud New Issue
2017-01-09 16:59 Lud File Added: CrashReport.zip
2017-01-09 17:06 Graf Zahl Note Added: 0000004
2017-01-09 17:08 Lud Note Added: 0000005
2017-01-09 17:40 Graf Zahl Note Added: 0000006
2017-01-09 17:40 Graf Zahl Status new => resolved
2017-01-10 13:47 Graf Zahl Resolution open => fixed
2017-01-11 03:19 Graf Zahl Assigned To => Graf Zahl
2017-01-11 03:19 Graf Zahl Status resolved => closed