[Fixed] IceGuyFX2 have a wrong target

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

IceGuyFX2 have a wrong target

Postby Kzer-Za » Tue Nov 24, 2020 3:12 am

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.
Kzer-Za
 
Joined: 20 Aug 2017

Re: IceGuyFX2 have a wrong target

Postby Player701 » Tue Nov 24, 2020 12:40 pm

I'm unable to reproduce this in GZDoom 4.5.0:

Code: Select allExpand view
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 allExpand view
FighterPlayer damaged by IceGuy with IceGuyFX
FighterPlayer damaged by IceGuy with IceGuyFX2

It never says that player was damaged by IceGuyFX with IceGuyFX2.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: IceGuyFX2 have a wrong target

Postby Kzer-Za » Tue Nov 24, 2020 1:55 pm

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 allExpand view
FighterPlayer damaged by IceGuyFX with IceGuyFX2
IceGuy damaged by IceGuyFX with IceGuyFX2
Kzer-Za
 
Joined: 20 Aug 2017

Re: IceGuyFX2 have a wrong target

Postby Player701 » Tue Nov 24, 2020 1:58 pm

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.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: IceGuyFX2 have a wrong target

Postby Kzer-Za » Tue Nov 24, 2020 2:05 pm

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.
Kzer-Za
 
Joined: 20 Aug 2017

Re: IceGuyFX2 have a wrong target

Postby Graf Zahl » Wed Nov 25, 2020 12:37 am

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 1 guest