Fix: Proper operation of projectile
Fixes: #2226
In the new commit adding the ability to add common events to weapons or items, there was a problem with incorrect inheritance in the case of projectile weapons and melee weapons. The video is on the bugs discord channel because it's too big. Here I am posting a smaller picture of what the situation looks like after fixing the error, in my opinion. bandicam 2024-04-12 08-21-31-021.zip
Wont this remove the on hit event? I am a bit confused of the change. Do you mind explaining the logic a bit more?
@Mighty-Professional It does not remove the on-hit event, but causes the projectile work onhit commonevent. I've already presented everything on the bugs channel. a video of how it worked, before the repair is on the channel and after the repair is here. everything works as it should. The bullets didn't work at all, and if they did, they inherited from the previous weapon indefinitely, so you could take the effect from other weapons and thus improve your ranged weapon.
@Mighty-Professional Maybe I'll explain it a little more precisely. The lastattackweapon was removed, which was intended to prevent the activation of the effect of a new weapon when quickly changing weapons, and it inherited the effect of the previous weapon. (I don't know why it was added, but you can prevent quick changing via CDR) Now correctly activates the weapon's trigger when auto-attacking. When lastattackweapon was available, projectile did not work at all and did not trigger the required effect
I don't agree with this solution, deleting random code until it stops causing a bug is not the way to go. Looking at how this works around the issue, a more likely culprit seems to be that firing a projectile doesn't set the LastAttackingWeapon variable correctly.
Closing this as the issue was solved by #2241