mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 07:38:00 +03:00
Minor refactoring API functions
This commit is contained in:
parent
d98e8f8b60
commit
34e56f61f2
@ -63,6 +63,10 @@ NEW_DLL_FUNCTIONS gNewDLLFunctions =
|
||||
nullptr
|
||||
};
|
||||
|
||||
#ifndef REGAMEDLL_API
|
||||
entvars_t *g_pevLastInflictor = nullptr;
|
||||
#endif
|
||||
|
||||
CMemoryPool hashItemMemPool(sizeof(hash_item_t), 64);
|
||||
|
||||
int CaseInsensitiveHash(const char *string, int iBounds)
|
||||
|
@ -341,7 +341,20 @@ inline CCSEntity *CBaseEntity::CSEntity() const
|
||||
{
|
||||
return m_pEntity;
|
||||
}
|
||||
#endif
|
||||
#else // !REGAMEDLL_API
|
||||
|
||||
extern entvars_t *g_pevLastInflictor;
|
||||
inline void CBaseEntity::SetDmgPenetrationLevel(int iPenetrationLevel) {}
|
||||
inline void CBaseEntity::ResetDmgPenetrationLevel() {}
|
||||
inline int CBaseEntity::GetDmgPenetrationLevel() const { return 0; }
|
||||
inline entvars_t *CBaseEntity::GetLastInflictor() { return g_pevLastInflictor; }
|
||||
inline void CBaseEntity::KilledInflicted(entvars_t *pevInflictor, entvars_t *pevAttacker, int iGib)
|
||||
{
|
||||
g_pevLastInflictor = pevInflictor;
|
||||
Killed(pevAttacker, iGib);
|
||||
g_pevLastInflictor = nullptr;
|
||||
}
|
||||
#endif // !REGAMEDLL_API
|
||||
|
||||
class CPointEntity: public CBaseEntity {
|
||||
public:
|
||||
|
@ -82,10 +82,6 @@ const char *CDeadHEV::m_szPoses[] =
|
||||
"deadtable"
|
||||
};
|
||||
|
||||
#ifndef REGAMEDLL_API
|
||||
entvars_t *g_pevLastInflictor;
|
||||
#endif
|
||||
|
||||
LINK_ENTITY_TO_CLASS(player, CBasePlayer, CCSPlayer)
|
||||
|
||||
#ifdef REGAMEDLL_API
|
||||
|
@ -976,9 +976,6 @@ inline CBasePlayer *UTIL_PlayerByIndexSafe(int playerIndex)
|
||||
return pPlayer;
|
||||
}
|
||||
|
||||
#ifndef REGAMEDLL_API
|
||||
extern entvars_t *g_pevLastInflictor;
|
||||
#endif
|
||||
extern CBaseEntity *g_pLastSpawn;
|
||||
extern CBaseEntity *g_pLastCTSpawn;
|
||||
extern CBaseEntity *g_pLastTerroristSpawn;
|
||||
|
@ -98,54 +98,34 @@ inline CBaseEntity *CCSEntity::BaseEntity() const
|
||||
return this->m_pContainingEntity;
|
||||
}
|
||||
|
||||
#ifdef REGAMEDLL_API
|
||||
inline void CBaseEntity::SetDmgPenetrationLevel(int iPenetrationLevel)
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
CSEntity()->m_ucDmgPenetrationLevel = iPenetrationLevel;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CBaseEntity::ResetDmgPenetrationLevel()
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
CSEntity()->m_ucDmgPenetrationLevel = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline int CBaseEntity::GetDmgPenetrationLevel() const
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
return CSEntity()->m_ucDmgPenetrationLevel;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void CBaseEntity::KilledInflicted(entvars_t* pevInflictor, entvars_t *pevAttacker, int iGib)
|
||||
inline void CBaseEntity::KilledInflicted(entvars_t *pevInflictor, entvars_t *pevAttacker, int iGib)
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
CSEntity()->m_pevLastInflictor = pevInflictor;
|
||||
#else
|
||||
g_pevLastInflictor = pevInflictor;
|
||||
#endif
|
||||
|
||||
Killed(pevAttacker, iGib);
|
||||
|
||||
#ifdef REGAMEDLL_API
|
||||
CSEntity()->m_pevLastInflictor = nullptr;
|
||||
#else
|
||||
g_pevLastInflictor = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline entvars_t* CBaseEntity::GetLastInflictor()
|
||||
inline entvars_t *CBaseEntity::GetLastInflictor()
|
||||
{
|
||||
#ifdef REGAMEDLL_API
|
||||
return CSEntity()->m_pevLastInflictor;
|
||||
#else
|
||||
return g_pevLastInflictor;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
class CCSDelay: public CCSEntity
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user