Fix some errors (#1020)

Fix some critical errors
This commit is contained in:
Unreal Karaulov
2021-12-03 00:47:57 +03:00
committed by GitHub
parent 5dcda02b65
commit 3cda059669
13 changed files with 37 additions and 23 deletions

View File

@ -295,10 +295,10 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
CPlayer* pAtt = GET_PLAYER_POINTER_I(att);
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
if ( !pAtt ) pAtt = pVic;
pVic->pEdict->v.dmg_inflictor = NULL;
pAtt->saveHit( pVic , weapon , dmg, aim );
if ( !pAtt ) pAtt = pVic;
int TA = 0;
if ( (pVic->pEdict->v.team == pAtt->pEdict->v.team ) && ( pVic != pAtt) )
TA = 1;

View File

@ -122,7 +122,8 @@ void Client_TSHealth_End(void* mValue){
weapon = 37; // throwing knife
aim = pAttacker ? pAttacker->aiming : 0;
pAttacker->saveHit( mPlayer , weapon , damage, aim );
if (pAttacker)
pAttacker->saveHit( mPlayer , weapon , damage, aim );
}
}
if ( !pAttacker ) pAttacker = mPlayer;