IceGuyFX2 have a wrong target

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
Kzer-Za
Posts: 521
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

IceGuyFX2 have a wrong target

Post by Kzer-Za »

They have the IceGuyFX that spawned them as their target instead of the IceGuy that launched the IceGuyFX.

Edit: I apologize, they actually have the IceGuy as their target. However, the reason why I thought they had a wrong target is because anything damaged by an IceGuyFX2 has IceGuyFX as the source of the damage instead of the IceGuy.
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: IceGuyFX2 have a wrong target

Post by Player701 »

I'm unable to reproduce this in GZDoom 4.5.0:

Code: Select all

class TestHandler : EventHandler
{
    override void WorldThingDamaged (WorldEvent e)
    {
        Console.Printf("%s damaged by %s with %s", GetName(e.Thing), GetName(e.DamageSource), GetName(e.Inflictor));
    }
    
    private static name GetName(Actor a)
    {
        return a == null ? 'NULL' : a.GetClassName();
    }
}
With IceGuy, I always get messages like:

Code: Select all

FighterPlayer damaged by IceGuy with IceGuyFX
FighterPlayer damaged by IceGuy with IceGuyFX2
It never says that player was damaged by IceGuyFX with IceGuyFX2.
Kzer-Za
Posts: 521
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: IceGuyFX2 have a wrong target

Post by Kzer-Za »

I tested again. For consistency's sake I used your code for eventhandler. Indeed, in some cases the source of the damage is IceGuyFX and in some cases it's IceGuy. It seems that it depends on the distance from which IceGuy shoots at you, which is why I thought that it's always IceGuyFX: I always got to the IceGuy face, so it was shooting me at point-blank range. If I get away from it, the message is like what you get. But if I get in his face, the messages are like this:

Code: Select all

FighterPlayer damaged by IceGuyFX with IceGuyFX2
IceGuy damaged by IceGuyFX with IceGuyFX2
User avatar
Player701
 
 
Posts: 1710
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: IceGuyFX2 have a wrong target

Post by Player701 »

Ah! You should have mentioned this only happens when the projectiles are fired at point-blank range. Indeed, there is something odd going on. It probably has something to do with the missile being immediately destroyed upon spawn. Unless a developer bothers to check this out soon, I'll try to remember to run some tests of my own tomorrow.
Kzer-Za
Posts: 521
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: IceGuyFX2 have a wrong target

Post by Kzer-Za »

Yes, I should have, but I when I was testing, I was getting right in front of the IceGuy, so I didn't notice before that it only happens at point-blank range. I'll try to be more thorough in the future.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: IceGuyFX2 have a wrong target

Post by Graf Zahl »

This is classic Doom at play. The missile spawning function can already destroy a projectile before its caller has any chance to set the owner. to something other than what it was called with. Most projectile functions require the owner as parameter - the one being used here was an exception.
Post Reply

Return to “Closed Bugs [GZDoom]”