[Bug] onObjectShot gets called for all players for explosions

Started by Spiller, Nov 04, 2021, 05:31 AM

Previous topic - Next topic

Spiller

Description
When you shoot an (tracked) object with explosions, the onObjectShot function is called for all the spawned players.

Reproducible
Always

What you think caused the bug
Explosion tracking was fixed in the QoL updates, it possibly exists ever since.

Quote from: AdTec_224 on Dec 24, 2020, 09:01 PM
  • Fixed an issue where onObjectShot was not being called for explosions

Video
Used this code on a blank server:

local Tree = CreateObject( 444, 1, Vector( -337.578, -519.728, 11.9022), 255 );
Tree.TrackingShots = true;

function onObjectShot( object, player, weapon )
{
if(object.ID == Tree.ID)
Message("[#7A7A7A]Shot by: [#C0C0C0]" + player.Name);
}

https://youtu.be/fKW00ujKLSY

Edit: Looks like a report already existed for this too (https://forum.vc-mp.org/?topic=8436.0) :facepalm: