Oh, and adding to it; you can do it the same way the gamerules determines what weapon is used to cause damage for the deathnotice. the pointer doesn't need to be set for that, because it checks the player who fired it. of course.. this is assuming you're doing multiplayer and not wanting to know what weapon an NPC is firing.
On Sun, Dec 14, 2014 at 5:11 PM, Tony "omega" Sergi <omegal...@gmail.com> wrote: > > the only time it's ever populated is if the weapon doing the damage > actually sets it while constructing the damage info. > default code, ie: single player, does not afaik. > (look at FireBullets) > > > On Sun, Dec 14, 2014 at 12:48 AM, David Buckley <druck...@gmail.com> > wrote: > >> Hi, >> >> I've been trying to record the weapon used on damage (using OnTakeDamage >> in basecombatcharacter.cpp). Unfortunately, the CTakeDamageInfo object >> doesn't seem to return a valid weapon with GetWeapon (it's NULL). It's >> possible the m_hWeapon variable in CTakeDamageInfo is never set? >> >> Is this the case, and if so, how do I figure out which weapon was used to >> cause damage? >> >> Many thanks >> >> _______________________________________________ >> To unsubscribe, edit your list preferences, or view the list archives, >> please visit: >> https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders >> >> >> > > -- > -Tony > -- -Tony
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders