Raised This Month: $ Target: $400
 0% 

Ham_TakeDamage with FF, Ham_TraceAttack not working correctly


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 07-17-2014 , 07:11   Re: Ham_TakeDamage with FF, Ham_TraceAttack not working correctly
Reply With Quote #5

All that does is call TakeDamage, which I'm already doing.

CBasePlayer::TraceAttack calls AddMultiDamage(), which does this:
Code:
void AddMultiDamage( entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType) {     if ( !pEntity )         return;     gMultiDamage.type |= bitsDamageType;     if ( pEntity != gMultiDamage.pEntity )     {         ApplyMultiDamage(pevInflictor,pevInflictor); // UNDONE: wrong attacker!         gMultiDamage.pEntity    = pEntity;         gMultiDamage.amount     = 0;     }     gMultiDamage.amount += flDamage; }

So in the end TraceAttack should send TakeDamage by itself, but it doesn't. At least not correctly...
I'm not sure what Arkshine's comment means, is it bugged in the CSSDK itself? If it is, that would kinda explain why there's no killer shown in the DeathMsg.


Anyway, seeing that my way is more or less correct, the real question still exists: How to fool TakeDamage so teamplayers can attack each other even if mp_friendlyfire is off? The only solution I can think of is to set mp_friendlyfire to 1 right before the damage and back to 0 after it, but is there anything better that this? It sounds dirty.

Last edited by Backstabnoob; 07-17-2014 at 07:24.
Backstabnoob is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode