diff --git a/modules/tfcx/usermsg.cpp b/modules/tfcx/usermsg.cpp index 81d8cde9..4dc1fc40 100644 --- a/modules/tfcx/usermsg.cpp +++ b/modules/tfcx/usermsg.cpp @@ -121,10 +121,23 @@ void Client_Damage(void* mValue){ if ( FNullEnt( enemy ) ) break; +#ifdef _DEBUG_TFCX + ALERT(at_logged, "Clinet_damage Called with state-%d dmg-%d Netname'%s'(Class'%s') slno-'%d'\n", + mState, damage, STRING(mPlayer->pEdict->v.netname), + STRING(mPlayer->pEdict->v.classname), mPlayer->pEdict->serialnumber); + + ALERT(at_logged, " Called with enemy-slno-%d Netname:'%s'(Class'%s')\n", mPlayer->pEdict->serialnumber, + STRING(enemy->v.netname), STRING(enemy->v.classname)); +#endif // _DEBUG_TFCX + if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) { // attacker is player and his active weapon pAttacker = GET_PLAYER_POINTER(enemy); - + +#ifdef _DEBUG_TFCX + ALERT(at_logged, " attacker is player and his active weapon id-%d, has flags - (FL_CLIENT | FL_FAKECLIENT)\n\n", pAttacker->current); +#endif // _DEBUG_TFCX + aim = pAttacker->aiming; weapon = pAttacker->current; @@ -150,6 +163,15 @@ void Client_Damage(void* mValue){ pAttacker = GET_PLAYER_POINTER(enemy->v.owner); +#ifdef _DEBUG_TFCX + ALERT(at_logged, " attacker is Class'%s'(with its enmy as Netname'%s'[Class'%s']) and his owner is '%s(%s)' enemy->owner has flags - FL_CLIENT | FL_FAKECLIENT\n\n", + (enemy ? STRING(enemy->v.classname) : "Null"), + (enemy->v.enemy ? STRING(enemy->v.enemy->v.netname) : "Null"), + (enemy->v.enemy ? STRING(enemy->v.enemy->v.classname) : "Null"), + (enemy->v.owner ? STRING(enemy->v.owner->v.netname) : "Null"), + (enemy->v.owner ? STRING(enemy->v.owner->v.classname) : "Null")); +#endif // _DEBUG_TFCX + const char *szClass = STRING(enemy->v.classname); switch(szClass[10]){ @@ -185,16 +207,8 @@ void Client_Damage(void* mValue){ if ( !weapon ) { switch(szClass[3]){ case 'e': - weapon = TFC_WPN_TIMER; // TFC_WPN_MEDKIT ?? - - tempInt = get_pdata_ehandle(mPlayer->pEdict, pdTimerOwner * 4); // function is char-based. - - if (tempInt < 1 || tempInt > gpGlobals->maxClients) - { - break; - } - - pAttacker = GET_PLAYER_POINTER_I(tempInt); + weapon = TFC_WPN_TIMER; // TFC_WPN_MEDKIT ?? //ShootingKing: Class - "timer" + pAttacker = GET_PLAYER_POINTER(enemy->v.enemy); if (pAttacker->teamId == mPlayer->teamId) // ??? {