Skip to content

Commit

Permalink
fix use indexOfPDataAmx
Browse files Browse the repository at this point in the history
  • Loading branch information
FEDERICOMB96 committed Feb 6, 2024
1 parent 4812e92 commit 15ba121
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion reapi/src/hook_callback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ void CSGameRules_SendDeathMessage(IReGameHook_CSGameRules_SendDeathMessage *chai
chain->callNext(getPrivate<CBaseEntity>(_pKiller), getPrivate<CBasePlayer>(_pVictim), getPrivate<CBasePlayer>(_pAssister), PEV(_pevInflictor), _killerWeaponName, _iDeathMessageFlags, _iRarityOfKill);
};

callVoidForward(RG_CSGameRules_SendDeathMessage, original, indexOfPData(pKiller), indexOfEdict(pVictim->pev), indexOfPData(pAssister), indexOfEdictAmx(pevInflictor), killerWeaponName, iDeathMessageFlags, iRarityOfKill);
callVoidForward(RG_CSGameRules_SendDeathMessage, original, indexOfPDataAmx(pKiller), indexOfEdict(pVictim->pev), indexOfPDataAmx(pAssister), indexOfEdictAmx(pevInflictor), killerWeaponName, iDeathMessageFlags, iRarityOfKill);
}

/*
Expand Down
9 changes: 0 additions & 9 deletions reapi/src/type_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ inline entvars_t* PEV(const int index)
return pvars;
}

template<typename T>
inline size_t indexOfPData(const T* pdata)
{
size_t index = 0;
if (likely(pdata != nullptr))
index = indexOfEdict(pdata->pev);
return index;
}

template<typename T>
inline size_t indexOfPDataAmx(const T* pdata)
{
Expand Down

0 comments on commit 15ba121

Please sign in to comment.