Fantastic, thank you. Adding SetWeapon in FireBullets and in other places
such as weapon_crossbow.cpp and basebludgeonweapon.cpp works. However,
there are three weapons which still aren't caught properly: the SMG's
grenade, the AR2's energy ball and the RPG's missile. While the
prop_combine_ball seems to create its own CTakeDamageInfo object (which
isn't passed to OnTakeDamage for some reason), the other two don't. Do you
have any idea on how to get round this?

Many thanks,

Dave

On 14 December 2014 at 08:12, Tony "omega" Sergi <omegal...@gmail.com>
wrote:

> 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
>
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to