NeotokyoRebuild / neo

NEOTOKYO Rebuild - Source SDK 2013 mod of NEOTOKYO
https://neotokyorebuild.github.io/
Other
16 stars 12 forks source link

Grenades show wrong killerinfo weapon #596

Open Rainyan opened 1 week ago

Rainyan commented 1 week ago

Build Info

v8.0-prealpha (b2291c5)

Description

Grenade kills incorrectly display the attack weapon as the weapon currently held by the attacker, not the grenade itself.

To Reproduce

Expected behavior

Killerinfo panel shows the name of the weapon currently held by the bot as the attack weapon, and not the grenade's name.

Actual behavior

Killerinfo panel shows the grenade's name as the attack weapon.

Operating System

Version/Distro

Mint 21.3 Cinnamon

Machine's CPU

No response

Machine's GPU

No response

GPU's driver

No response

Build's compiler

No response

Additional context and Screenshots

killerinfo.webm

AdamTadeusz commented 1 week ago

In the case of thrown projectiles like grenades the weapon used to spawn the grenade projectile is usually deleted by the time the projectile kills a player. In those cases the easiest value to return that would be meaningful to the person who died would be the class name of the projectile returned by GetInflictor() image Could also match the class name of the projectile to some expected values to make it look nicer than neo_grenade_frag for example

AdamTadeusz commented 1 week ago

image

xedmain commented 1 week ago

having it have the same names as in og nt for detpacks and frags will make porting some plugins easier (ex. killstreak sounds plugin uses them, as well as probably log parsers and neotokyo's hlstats:x)

AdamTadeusz commented 1 week ago

you mean plugins can actually read this information in this box? If so, do you know what the og nt name for detpacks and frags is?

Rainyan commented 6 days ago

Plugins generally listen for the player_death event: https://wiki.alliedmods.net/Neotokyo_Events

It might be cleaner to implement this event with parity, if not done already, and use a client side listener for it. It would be what plugins like Killer info display use, and is presumably what we'd wanna emulate for the feature.

Although I should add, personally I don't like having this killerinfo thing as a built-in feature at all - IMO it should remain a SourceMod plugin.

edit: I see you already did a PR. Well, these were just some ramblings, maybe for a future round of refactoring.

xedmain commented 6 days ago

you mean plugins can actually read this information in this box? If so, do you know what the og nt name for detpacks and frags is?

you can kill yourself using a grenade or detpack on a server with killer info display and it'll show it. I'll be home only at 21:00 CEST unfortunately, but when I come I'll be able to look in the source code for killstreak plugin

xedmain commented 5 days ago

frag grenade: grenade_projectile detpack: grenade_detapack