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.
IceGuyFX2 have a wrong target
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.
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.
- Player701
-
- Posts: 1710
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: IceGuyFX2 have a wrong target
I'm unable to reproduce this in GZDoom 4.5.0:
With IceGuy, I always get messages like:
It never says that player was damaged by IceGuyFX with IceGuyFX2.
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();
}
}
Code: Select all
FighterPlayer damaged by IceGuy with IceGuyFX
FighterPlayer damaged by IceGuy with IceGuyFX2
Re: IceGuyFX2 have a wrong target
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
- Player701
-
- Posts: 1710
- Joined: Wed May 13, 2009 3:15 am
- Graphics Processor: nVidia with Vulkan support
- Contact:
Re: IceGuyFX2 have a wrong target
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.
Re: IceGuyFX2 have a wrong target
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49225
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: IceGuyFX2 have a wrong target
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.