[BUG] In onPlayerKill reason id bugged with custom weapons

Started by Banaqs, Aug 04, 2015, 04:15 PM

Previous topic - Next topic

Banaqs

Description
In onPlayerKill reason id bugged with custom weapons

Reproducible
Always

What you were doing when the bug happened
I was killing other player with custom weapon and reason id != weapon id.

What you think caused the bug
I dont know what cause this bug. Maybe developers mistake.

Sorry for my poor english, i was wrote that post from my phone and i can't use google translate...

Thijn

The weapon id for custom IDs will always be the weapon ID it's based on.
I asked Stormeus about this a few months ago:
Quote[Sat - 12:31:58] <Thijn> We have a few custom weapons in our server, but for some reason they only report the weaponID they're based on when you kill someone
[Sat - 12:32:14] <Thijn> Is this expected behavior?
[Sat - 12:32:31] <Stormeus> That sounds logical but I can't say if it's necessarily expected behavior
[Sat - 12:32:49] <Stormeus> One sec, let me see if I can figure that out from max's implementation
[Sat - 12:32:56] <Thijn> Cheers, thanks
[Sat - 12:37:12] <Stormeus> I don't think it's so much expected behavior as it is a side effect of how this is implemented
[Sat - 12:37:24] <Stormeus> In order for the necessary game hooks to work the game is passed the "logical" ID of the weapon
[Sat - 12:37:32] <Stormeus> Which is what it records when a player gets shot, instead of the proper weapon ID
[Sat - 12:37:38] <Thijn> Ah, makes sense
[Sat - 12:37:58] <Thijn> No workound so squirrel knows the actual custom one?
[Sat - 12:39:44] <Stormeus> Not that I can think of right now at least
[Sat - 12:40:15] <Stormeus> Though I suppose you could keep track of if players have custom weapons instead of stock, and just intercept the ID on death
[Sat - 12:40:36] <Stormeus> A proper fix would involve messing with the client internals, and there's an update I'm trying to push right now, so I'll have to get to it later

If he did actually get around messing around with the client internals I don't know, but I would imagine it would require some fiddling to get right.