MantisBT - Zandronum
View Issue Details
0000450Zandronum[All Projects] Bugpublic2011-05-16 23:572018-09-30 22:50
Blzut3 
Blzut3 
normalminoralways
closedno change required 
LinuxUbuntu10.04 x86
1.0 
 
0000450: SetActivatorToTarget Error
For a mod I have an thing to upon death execute a script which calls SetActivatorToTarget(0). This thing should only be destructible by a player and thus SetActivatorToTarget should set the activator to the player that destroyed the object.

However, if the object was destroyed by a projectile (confirmed for a rocket any ways), and another player on a different team kills the player that fired the rocket before the rocket hits the object. The activator will change to the killer instead of the owner of the rocket.

Upon further investigation, it seems this only happens when a player is the killer since I could not reproduce it with monsters (or even having a monster kill me).
No tags attached.
7z targetbug.7z (11,090) 2011-05-17 20:24
/tracker/file_download.php?file_id=326&type=bug
Issue History
2011-05-16 23:57Blzut3New Issue
2011-05-17 00:11Torr SamahoNote Added: 0001648
2011-05-17 00:47Blzut3Note Added: 0001649
2011-05-17 00:55Torr SamahoNote Added: 0001650
2011-05-17 01:00Blzut3Note Added: 0001651
2011-05-17 01:42Blzut3Note Added: 0001655
2011-05-17 20:24Blzut3File Added: targetbug.7z
2011-05-17 20:26Blzut3Note Added: 0001662
2011-05-18 00:04Torr SamahoNote Added: 0001665
2011-05-18 00:14Blzut3Note Added: 0001666
2011-05-18 01:07Torr SamahoNote Added: 0001670
2011-05-19 19:18Blzut3Note Added: 0001691
2011-05-19 19:18Blzut3Statusnew => resolved
2011-05-19 19:18Blzut3Resolutionopen => no change required
2011-05-19 19:18Blzut3Assigned To => Blzut3
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2018-09-30 22:50Blzut3Statusresolved => closed

Notes
(0001648)
Torr Samaho   
2011-05-17 00:11   
Does ZDoom behave the same?

Does it matter if the killed player respawns before the rocket hits the object?
(0001649)
Blzut3   
2011-05-17 00:47   
Haven't tested ZDoom yet.

The answer to the second question should be no since it seems to be noticed most when it happens for the last point in a match. (No time to respawn.) And I'm pretty sure our tests last night didn't involve respawning.

That said in my failed monster based tests it seems like it should work even if the player respawns (playernumber() returns the correct player). This only "issue" there is the dead player loses it's TID. That's unrelated to this problem though.
(0001650)
Torr Samaho   
2011-05-17 00:55   
I had Skulltag's code that reassigns projectiles to their shooter after the shooter respawns in mind. This code doesn't do anything though before the player respawns, so it can't be the culprit then.
(0001651)
Blzut3   
2011-05-17 01:00   
Decay just ran some more tests with Skulltag. Apparently by respawning before the rocket hits the point goes to the proper player. If you don't respawn the bug happens.

Still working on a test for ZDoom.
(0001655)
Blzut3   
2011-05-17 01:42   
Hmm. I can't get the issue to happen with ZDoom, nor can I get the issue to happen with my stripped down test wad even in Skulltag. This lead me to believe it might have something to do with the designated teams stuff, but it seems unlikely (since we're not using the friendly flag). Anyhow we'll have to do more tests later.
(0001662)
Blzut3   
2011-05-17 20:26   
Torr, I uploaded a r3216 demo showing the bug followed by showing the script working properly. I believe you already have the overload mod correct?
(0001665)
Torr Samaho   
2011-05-18 00:04   
> I believe you already have the overload mod correct?

I have revision 99. Is this the correct one?
(0001666)
Blzut3   
2011-05-18 00:14   
Yes
(0001670)
Torr Samaho   
2011-05-18 01:07   
Ok, I see the effect in the demo. Unfortunately the demo doesn't allow to debug this since all the decisions, i.e. who is whose target, were already made by the server during the recording.

I think in order to debug this we need a minimal example wad that is compatible with ZDoom.
(0001691)
Blzut3   
2011-05-19 19:18   
Found the user error. The player activates a things special when it kills the thing, not the thing itself (as would be the case if ACS_Execute is called in the death state). SetActivatorToTarget(0) fails to change the activator if the activator has no target (alive) which gave it the appearance that it worked.