Report split from news topic

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

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 Reply
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Report split from news topic

Post by DoomKrakken »

In version 3.4 of GZDoom, one of the changes made had it so that WorldThingDamaged is triggered before WorldThingDied.

This breaks plenty of core aspects of my mod, which doesn't create its own monsters, and depends on the knowledge of what projectiles killed which monster by what source.

For example:

Code: Select all

Override Void WorldThingDamaged(WorldEvent e)
{
      If (e.Inflictor && e.Thing.bISMONSTER && e.Thing.bKILLED && e.DamageSource)
            If ((e.Inflictor.CheckClass("ChargedBurstTracer1") || e.Inflictor.CheckClass("ChargedBurstTracer2") || e.Inflictor.CheckClass("ChargedBurstTracer3")) && (e.Thing.CheckClass("Fatso") || e.Thing.CheckClass("Fatso", AAPTR_DEFAULT, 1)) && e.DamageSource.CountInv("MC_PowerShot"))
            {
                e.DamageSource.A_GiveInventory("PowerShotMasteryCounter");
                e.DamageSource.A_GiveInventory("MasteryTicker");
            }
            If (e.Inflictor.CheckClass("SuperShotgunTracer"))
            {
                If (e.DamageSource.CountInv("MC_DoubleTrouble") && !(e.DamageSource.CountInv("PowerDoubleTroubleKillCounter1") && e.DamageSource.CountInv("PowerDoubleTroubleKillCounter2")))
                {
                    If (e.DamageSource.CountInv("PowerDoubleTroubleKillCounter1") && !e.Thing.CountInv("PowerAlreadyHit"))
                    {
                        e.DamageSource.A_GiveInventory("DoubleTroubleKillCounter2");
                    }
                    Else
                    {
                        e.Thing.A_GiveInventory("AlreadyHit");
                        e.DamageSource.A_GiveInventory("DoubleTroubleKillCounter1");
                    }
                }
            }
            If (e.Inflictor.CheckClass("HARTracer"))
            {
                If (e.DamageSource.CountInv("MC_DevastatorRounds") && e.Inflictor.CountInv("TacticalScopeReady") && !e.Thing.CountInv("PowerAlreadyHit"))
                {
                    e.Thing.A_GiveInventory("AlreadyHit");
                    e.DamageSource.A_GiveInventory("DevastatorRoundsMasteryCounter");
                    e.DamageSource.A_GiveInventory("MasteryTicker");
                    Let Messenger = EOA_PlayerBase(e.DamageSource);
                    If (Messenger)
                    {
                        Messenger.PrintUpgradeProgress("Weapon Upgrade Challenge:", "Devastator Rounds", "DevastatorRoundsMasteryCounter");
                    }
                }
            }
            If (e.Inflictor.CheckClass("RemoteDetonationExplosion") && e.DamageSource.CountInv("MC_ExternalPayload") && !(e.Inflictor.CountInv("ExternalPayloadKillCounter") >= 3))
            {
                e.Inflictor.A_GiveInventory("ExternalPayloadKillCounter");
                If (e.Inflictor.CountInv("ExternalPayloadKillCounter") >= 3)
                {
                    e.DamageSource.A_GiveInventory("ExternalPayloadMasteryCounter");
                    e.DamageSource.A_GiveInventory("MasteryTicker");
                }
            }
        }
} 
Unless there is a way to perform these very same checks in WorldThingDied or a similar function, I request that the timing of WorldThingDamaged is restored to its original behavior (where it's triggered at the same time as or after WorldThingDied).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: GZDoom 3.4.1 Released

Post by Graf Zahl »

This isn't a place to make bug reports. But anyway, damaging happens before dying, so the order was clearly not correct and caused logic errors (like, for example, calling the "damaged" event AFTER the actor was destroyed by getting killed.)
User avatar
DoomKrakken
Posts: 3482
Joined: Sun Oct 19, 2014 6:45 pm
Location: Plahnit Urff
Contact:

Re: Report split from news topic

Post by DoomKrakken »

First off, it wasn't a bug report. I knew it wasn't a mistake, and I knew it was intentional.

Second, disregard my panicked request. A simple alteration was proposed (e.Thing.Health <= 0) and now it works perfectly, if not slightly better.

Thank you for your time. :D
Post Reply

Return to “Closed Bugs [GZDoom]”