Consistency: Replace GETEDICT with HLTypeConversion in core
This commit is contained in:
parent
b65a0600ee
commit
9bee1f7edf
@ -83,7 +83,7 @@ static cell AMX_NATIVE_CALL emit_sound(AMX *amx, cell *params) /* 7 param */
|
||||
EMIT_SOUND_DYN2(pPlayer->pEdict, channel, szSample, vol, att, flags, pitch);
|
||||
}
|
||||
} else {
|
||||
edict_t* pEdict = GETEDICT(params[1]);
|
||||
edict_t* pEdict = TypeConversion.id_to_edict(params[1]);
|
||||
|
||||
if (!FNullEnt(pEdict))
|
||||
EMIT_SOUND_DYN2(pEdict, channel, szSample, vol, att, flags, pitch);
|
||||
|
@ -52,6 +52,7 @@
|
||||
#include "CvarManager.h"
|
||||
#include "CoreConfig.h"
|
||||
#include <amxmodx_version.h>
|
||||
#include <HLTypeConversion.h>
|
||||
|
||||
#define AMXXLOG_Log g_log.Log
|
||||
#define AMXXLOG_Error g_log.LogError
|
||||
@ -145,7 +146,6 @@ void UTIL_TrimRight(char *buffer);
|
||||
#define GET_PLAYER_POINTER(e) (&g_players[ENTINDEX(e)])
|
||||
//#define GET_PLAYER_POINTER(e) (&g_players[(((int)e-g_edict_point)/sizeof(edict_t))])
|
||||
#define GET_PLAYER_POINTER_I(i) (&g_players[i])
|
||||
#define GETEDICT(n) ((n >= 1 && n <= gpGlobals->maxClients) ? GET_PLAYER_POINTER_I(n)->pEdict : INDEXENT(n))
|
||||
|
||||
struct WeaponsVault
|
||||
{
|
||||
@ -369,5 +369,6 @@ enum PrintColor
|
||||
};
|
||||
|
||||
extern enginefuncs_t *g_pEngTable;
|
||||
extern HLTypeConversion TypeConversion;
|
||||
|
||||
#endif // AMXMODX_H
|
||||
|
@ -423,7 +423,7 @@ static cell _message_begin(AMX *amx, cell *params, bool useFloat) /* 4 param */
|
||||
return 0;
|
||||
}
|
||||
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL, GETEDICT(params[4]));
|
||||
MESSAGE_BEGIN(params[1], params[2], NULL, TypeConversion.id_to_edict(params[4]));
|
||||
break;
|
||||
}
|
||||
|
||||
@ -771,7 +771,7 @@ static cell _emessage_begin(AMX *amx, cell *params, bool useFloat)
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_pEngTable->pfnMessageBegin(params[1], params[2], NULL, GETEDICT(params[4]));
|
||||
g_pEngTable->pfnMessageBegin(params[1], params[2], NULL, TypeConversion.id_to_edict(params[4]));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -147,6 +147,7 @@ int FF_ClientAuthorized = -1;
|
||||
int FF_ChangeLevel = -1;
|
||||
|
||||
IFileSystem* g_FileSystem;
|
||||
HLTypeConversion TypeConversion;
|
||||
|
||||
bool ColoredMenus(const char *ModName)
|
||||
{
|
||||
@ -518,6 +519,8 @@ int C_Spawn(edict_t *pent)
|
||||
|
||||
modules_callPluginsLoaded();
|
||||
|
||||
TypeConversion.init();
|
||||
|
||||
// ###### Call precache forward function
|
||||
g_dontprecache = false;
|
||||
executeForwards(FF_PluginPrecache);
|
||||
|
@ -63,7 +63,7 @@ static cell AMX_NATIVE_CALL VelocityByAim(AMX *amx, cell *params)
|
||||
}
|
||||
pEnt = GET_PLAYER_POINTER_I(iEnt)->pEdict;
|
||||
} else {
|
||||
pEnt = INDEXENT(iEnt);
|
||||
pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ static cell AMX_NATIVE_CALL lookup_sequence(AMX* amx, cell* params)
|
||||
|
||||
for (int i = 0; i < pstudiohdr->numseq; i++)
|
||||
{
|
||||
if (stricmp( pseqdesc[i].label, label ) == 0)
|
||||
if (strcasecmp( pseqdesc[i].label, label ) == 0)
|
||||
{
|
||||
REAL* FrameRate = reinterpret_cast<REAL*>(MF_GetAmxAddr(amx, params[3]));
|
||||
cell* Loops = MF_GetAmxAddr(amx, params[4]);
|
||||
|
@ -9,8 +9,9 @@
|
||||
#ifndef _HL_CONVERSION_TYPE_H_
|
||||
#define _HL_CONVERSION_TYPE_H_
|
||||
|
||||
#include <stddef.h> // size_t
|
||||
#include <extdll.h> // edict_t, etc.
|
||||
#include <stddef.h> // size_t
|
||||
#include <extdll.h> // edict_t, etc.
|
||||
#include <sdk_util.h> // FNullEnt, INDEXENT, etc.
|
||||
|
||||
template <typename T> static inline T& ref_pdata(void *pPrivateData, int offset, int element = 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user