Skip to content

Commit

Permalink
rg_give_defusekit(): Add player team check (#234)
Browse files Browse the repository at this point in the history
Add player team check to avoid unexpected behavior
  • Loading branch information
Giferns committed Mar 31, 2023
1 parent b85d4ae commit ac3d641
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions reapi/src/natives/natives_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,6 +1259,10 @@ cell AMX_NATIVE_CALL rg_give_defusekit(AMX *amx, cell *params)
if (CSGameRules() != nullptr && !CSGameRules()->m_bMapHasBombTarget && !CSGameRules()->m_bMapHasBombZone) {
return FALSE;
}

if (pPlayer->m_iTeam != CT) {
return FALSE;
}

pPlayer->m_bHasDefuser = params[arg_def] ? true : false;
pPlayer->pev->body = params[arg_def] ? 1 : 0;
Expand Down

0 comments on commit ac3d641

Please sign in to comment.