[CSX] client_death reports wpnid as 0 when killed by bomb
Shouldn't it return CSW_C4? If you are killed by the bomb in CS it says you were killed by weapon id 0.
Test code: Code:
Result: Quote:
|
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
Also, this is how i'm working around it:
Code:
|
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
I believe in the older versions of CSX it returned CSW_C4. Though the planted C4 isn't actually a "weapon_c4" but a "grenade" which isn't a weapon. [edited]
|
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
Indeed, when you are killed by C4, you are killed by a grenade.
However, the question is whether CSX should be abstracting past this or not. |
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
Currently, IIRC, the forward return HE grenade weapon index for HE grenade kill. So why it was made to not return CSW_C4 [cut]. Seems illogical to me.
In my opinion "abstracting" wouldn't make worse since players can't kill someone with actual "weapon_hegrenade" or "weapon_c4" anyway. |
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
I don't like that, and if I were to redo it (which I can't, for backwards compatibility), I would make it be consistent and return WEAPON_HEGRENADE.
That said, my thoughts: Encapsulating it to return CSW_C4 is a good idea. Saying you can't kill them with the "actual weapon" is semantics at best, implementation dependent at worst. What wpnindex should mean is "which weapon CAUSED death." By your logic, it should return the index of an M4A1 instead of WEAPON_M4A1, because it was actually a bullet that killed them ;) As long as it doesn't break old code I don't mind making this change. |
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
yay! BAIL ftw!
|
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
I've made some testings and found that if you standing close to the center of the explosion it will return WID == 0 (dmg_inflictor has "env_explosion" classname). But if you are not close it will return CSW_C4 (dmg_inflictor's classname is "grenade" in this case). So the forward able to return CSW_C4 but not in the all cases.
But i personally would not use client_death forward anyway, at least because it's not called on user_kill native execution or on falldamage death. |
Re: [CSX] client_death reports wpnid as 0 when killed by bomb
True, thats why you do the check like in my above example :)
|
| All times are GMT -4. The time now is 20:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.