Consistency: Replace INDEXENT2 with HLTypeConversion in engine module
This commit is contained in:
parent
429a4596c1
commit
e52fc14114
|
@ -18,8 +18,7 @@ void CreateDetours();
|
|||
void DestroyDetours();
|
||||
|
||||
CDetour *LightStyleDetour = NULL;
|
||||
|
||||
edict_t *g_player_edicts[33];
|
||||
HLTypeConversion TypeConversion;
|
||||
|
||||
int AmxStringToEngine(AMX *amx, cell param, int &len)
|
||||
{
|
||||
|
@ -73,6 +72,8 @@ void OnAmxxDetach()
|
|||
|
||||
void OnPluginsLoaded()
|
||||
{
|
||||
TypeConversion.init();
|
||||
|
||||
g_CameraCount=0;
|
||||
pfnThinkForward = MF_RegisterForward("pfn_think", ET_STOP, FP_CELL, FP_DONE); // done
|
||||
PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE); // done
|
||||
|
@ -176,7 +177,7 @@ void ClientDisconnect(edict_t *pEntity)
|
|||
{
|
||||
int id = ENTINDEX(pEntity);
|
||||
|
||||
if (plinfo[ENTINDEX(pEntity)].iViewType != CAMERA_NONE) // Verify that they were originally in a modified view
|
||||
if (plinfo[id].iViewType != CAMERA_NONE) // Verify that they were originally in a modified view
|
||||
{
|
||||
g_CameraCount--;
|
||||
if (g_CameraCount < 0)
|
||||
|
@ -226,14 +227,6 @@ void ServerDeactivate()
|
|||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
|
||||
{
|
||||
for(int f = 1; f <= gpGlobals->maxClients;f++)
|
||||
g_player_edicts[f]=pEdictList + f;
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
DETOUR_DECL_STATIC2(LightStyle, void, int, style, const char *, val) // void (*pfnLightStyle) (int style, const char* val);
|
||||
{
|
||||
DETOUR_STATIC_CALL(LightStyle)(style, val);
|
||||
|
|
|
@ -287,7 +287,7 @@ static cell AMX_NATIVE_CALL trace_normal(AMX *amx, cell *params)
|
|||
Vector vStart = Vector(fStartX, fStartY, fStartZ);
|
||||
Vector vEnd = Vector(fEndX, fEndY, fEndZ);
|
||||
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, iEnt > 0 ? INDEXENT2(iEnt) : NULL, &g_tr);
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, iEnt > 0 ? TypeConversion.id_to_edict(iEnt) : NULL, &g_tr);
|
||||
|
||||
vRet[0] = amx_ftoc(g_tr.vecPlaneNormal.x);
|
||||
vRet[1] = amx_ftoc(g_tr.vecPlaneNormal.y);
|
||||
|
@ -321,7 +321,7 @@ static cell AMX_NATIVE_CALL trace_line(AMX *amx, cell *params)
|
|||
Vector vEnd = Vector(fEndX, fEndY, fEndZ);
|
||||
|
||||
if (iEnt > 0)
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, INDEXENT2(iEnt), &g_tr);
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, TypeConversion.id_to_edict(iEnt), &g_tr);
|
||||
else
|
||||
TRACE_LINE(vStart, vEnd, ignore_monsters, NULL, &g_tr);
|
||||
|
||||
|
@ -376,7 +376,7 @@ static cell AMX_NATIVE_CALL get_info_keybuffer(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(iEnt);
|
||||
}
|
||||
|
||||
char *info = GETINFOKEYBUFFER((iEnt == -1) ? NULL : INDEXENT2(iEnt));
|
||||
char *info = GETINFOKEYBUFFER((iEnt == -1) ? NULL : TypeConversion.id_to_edict(iEnt));
|
||||
|
||||
return MF_SetAmxStringUTF8Char(amx, params[2], info, strlen(info), params[3]);
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ static cell AMX_NATIVE_CALL drop_to_floor(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY(iEnt);
|
||||
|
||||
edict_t *e = INDEXENT2(iEnt);
|
||||
edict_t *e = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
return DROP_TO_FLOOR(e);
|
||||
}
|
||||
|
@ -405,7 +405,7 @@ static cell AMX_NATIVE_CALL attach_view(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(iIndex);
|
||||
CHECK_ENTITY(iTargetIndex);
|
||||
|
||||
SET_VIEW(INDEXENT2(iIndex), INDEXENT2(iTargetIndex));
|
||||
SET_VIEW(TypeConversion.id_to_edict(iIndex), TypeConversion.id_to_edict(iTargetIndex));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ static cell AMX_NATIVE_CALL set_view(AMX *amx, cell *params) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
edict_t *pPlayer = INDEXENT2(iIndex);
|
||||
edict_t *pPlayer = TypeConversion.id_to_edict(iIndex);
|
||||
edict_t *pNewCamera;
|
||||
|
||||
switch(iCameraType)
|
||||
|
@ -603,7 +603,7 @@ static cell AMX_NATIVE_CALL trace_hull(AMX *amx,cell *params)
|
|||
vEnd = vStart;
|
||||
|
||||
|
||||
TRACE_HULL(vStart, vEnd, params[4], params[2], iEnt > 0 ? INDEXENT2(iEnt) : NULL, &g_tr);
|
||||
TRACE_HULL(vStart, vEnd, params[4], params[2], iEnt > 0 ? TypeConversion.id_to_edict(iEnt) : NULL, &g_tr);
|
||||
|
||||
if (g_tr.fStartSolid) {
|
||||
iResult += 1;
|
||||
|
@ -640,7 +640,7 @@ static cell AMX_NATIVE_CALL playback_event(AMX *amx, cell *params)
|
|||
if (params[2] > 0) {
|
||||
CHECK_ENTITY(params[2]);
|
||||
}
|
||||
pInvoker=INDEXENT2(params[2]);
|
||||
pInvoker=TypeConversion.id_to_edict(params[2]);
|
||||
eventindex=params[3];
|
||||
delay=amx_ctof(params[4]);
|
||||
cell *cOrigin=MF_GetAmxAddr(amx, params[5]);
|
||||
|
@ -673,7 +673,7 @@ static cell AMX_NATIVE_CALL get_usercmd(AMX *amx, cell *params)
|
|||
switch(type)
|
||||
{
|
||||
case usercmd_lerp_msec:
|
||||
return g_cmd->lerp_msec;
|
||||
return g_cmd->lerp_msec;
|
||||
case usercmd_msec:
|
||||
return g_cmd->msec;
|
||||
case usercmd_lightlevel:
|
||||
|
@ -745,7 +745,7 @@ static cell AMX_NATIVE_CALL set_usercmd(AMX *amx, cell *params)
|
|||
switch(type)
|
||||
{
|
||||
case usercmd_lerp_msec:
|
||||
g_cmd->lerp_msec = iValue;
|
||||
g_cmd->lerp_msec = iValue;
|
||||
return 1;
|
||||
case usercmd_msec:
|
||||
g_cmd->msec = iValue;
|
||||
|
@ -818,8 +818,8 @@ static cell AMX_NATIVE_CALL is_visible(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(src);
|
||||
CHECK_ENTITY(dest);
|
||||
|
||||
edict_t *pEntity = INDEXENT2(src);
|
||||
edict_t *pTarget = INDEXENT2(dest);
|
||||
edict_t *pEntity = TypeConversion.id_to_edict(src);
|
||||
edict_t *pTarget = TypeConversion.id_to_edict(dest);
|
||||
|
||||
if (pTarget->v.flags & FL_NOTARGET)
|
||||
return 0;
|
||||
|
@ -827,7 +827,7 @@ static cell AMX_NATIVE_CALL is_visible(AMX *amx, cell *params)
|
|||
Vector vLooker = pEntity->v.origin + pEntity->v.view_ofs;
|
||||
Vector vTarget = pTarget->v.origin + pTarget->v.view_ofs;
|
||||
|
||||
TraceResult tr;
|
||||
TraceResult tr;
|
||||
|
||||
TRACE_LINE(vLooker, vTarget, FALSE, pEntity, &tr);
|
||||
|
||||
|
@ -846,7 +846,7 @@ static cell AMX_NATIVE_CALL in_view_cone(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY(src);
|
||||
|
||||
edict_t *pEdictSrc = INDEXENT(src);
|
||||
edict_t *pEdictSrc = TypeConversion.id_to_edict(src);
|
||||
|
||||
Vector vecLOS, vecForward;
|
||||
float flDot;
|
||||
|
@ -968,7 +968,7 @@ static cell AMX_NATIVE_CALL trace_forward(AMX *amx, cell *params)
|
|||
cell *shortestDistHigh = MF_GetAmxAddr(amx, params[9]);
|
||||
|
||||
if(fGive < 0.0)
|
||||
fGive = 20.0;
|
||||
fGive = 20.0;
|
||||
|
||||
REAL fStartX = amx_ctof(cStart[0]);
|
||||
REAL fStartY = amx_ctof(cStart[1]);
|
||||
|
@ -996,29 +996,29 @@ static cell AMX_NATIVE_CALL trace_forward(AMX *amx, cell *params)
|
|||
|
||||
for(int inum=-36;inum<=36;inum++)
|
||||
{
|
||||
REAL fUseZ = fStartZ + (REAL)inum;
|
||||
Vector vStart = Vector(fStartX, fStartY, fUseZ);
|
||||
Vector vEnd = Vector(fEndX, fEndY, fUseZ);
|
||||
if(iIgnoreEnt > 0)
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, INDEXENT2(iIgnoreEnt), &tr);
|
||||
REAL fUseZ = fStartZ + (REAL)inum;
|
||||
Vector vStart = Vector(fStartX, fStartY, fUseZ);
|
||||
Vector vEnd = Vector(fEndX, fEndY, fUseZ);
|
||||
if(iIgnoreEnt > 0)
|
||||
TRACE_LINE(vStart, vEnd, dont_ignore_monsters, TypeConversion.id_to_edict(iIgnoreEnt), &tr);
|
||||
else
|
||||
TRACE_LINE(vStart, vEnd, ignore_monsters, NULL, &tr);
|
||||
fRetX = tr.vecEndPos.x;
|
||||
fRetY = tr.vecEndPos.y;
|
||||
fRetZ = tr.vecEndPos.z;
|
||||
Vector vHit = Vector(fRetX, fRetY, fRetZ);
|
||||
fRetX = tr.vecEndPos.x;
|
||||
fRetY = tr.vecEndPos.y;
|
||||
fRetZ = tr.vecEndPos.z;
|
||||
Vector vHit = Vector(fRetX, fRetY, fRetZ);
|
||||
|
||||
REAL fLength = (vStart - vHit).Length();
|
||||
if(fabs(fLength - fClosestDist) < fGive)
|
||||
fClosestHigh = fUseZ - fStartZ;
|
||||
else if(fLength < fClosestDist)
|
||||
{
|
||||
fClosestDist = fLength;
|
||||
fClosestLow = fUseZ - fStartZ;
|
||||
fClosestHigh = fUseZ - fStartZ;
|
||||
fClosestX = fRetX;
|
||||
fClosestY = fRetY;
|
||||
}
|
||||
REAL fLength = (vStart - vHit).Length();
|
||||
if(fabs(fLength - fClosestDist) < fGive)
|
||||
fClosestHigh = fUseZ - fStartZ;
|
||||
else if(fLength < fClosestDist)
|
||||
{
|
||||
fClosestDist = fLength;
|
||||
fClosestLow = fUseZ - fStartZ;
|
||||
fClosestHigh = fUseZ - fStartZ;
|
||||
fClosestX = fRetX;
|
||||
fClosestY = fRetY;
|
||||
}
|
||||
}
|
||||
fClosestLow += 36.0;
|
||||
fClosestHigh += 36.0;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <amtl/am-vector.h>
|
||||
#include <amtl/am-string.h>
|
||||
#include <CDetour/detours.h>
|
||||
#include <HLTypeConversion.h>
|
||||
|
||||
extern DLL_FUNCTIONS *g_pFunctionTable;
|
||||
extern DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||
|
@ -49,6 +50,7 @@ extern int VexdTouchForward;
|
|||
extern int VexdServerForward;
|
||||
|
||||
extern CDetour *LightStyleDetour;
|
||||
extern HLTypeConversion TypeConversion;
|
||||
|
||||
#define AMS_OFFSET 0.01
|
||||
|
||||
|
@ -168,16 +170,6 @@ int AmxStringToEngine(AMX *amx, cell param, int &len);
|
|||
edict_t *UTIL_FindEntityInSphere(edict_t *pStart, const Vector &vecCenter, float flRadius);
|
||||
|
||||
extern int g_CameraCount;
|
||||
extern edict_t *g_player_edicts[33];
|
||||
|
||||
inline edict_t* INDEXENT2( int iEdictNum )
|
||||
{
|
||||
if (iEdictNum >= 1 && iEdictNum <= gpGlobals->maxClients)
|
||||
return MF_GetPlayerEdict(iEdictNum);
|
||||
|
||||
else
|
||||
return (*g_engfuncs.pfnPEntityOfEntIndex)(iEdictNum);
|
||||
}
|
||||
|
||||
int Spawn(edict_t *pEntity);
|
||||
void PlaybackEvent(int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2);
|
||||
|
@ -196,7 +188,7 @@ void StartFrame_Post();
|
|||
MF_LogError(amx, AMX_ERR_NATIVE, "Entity out of range (%d)", x); \
|
||||
return 0; \
|
||||
} else { \
|
||||
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||
if (x != 0 && FNullEnt(TypeConversion.id_to_edict(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
|
@ -213,7 +205,7 @@ void StartFrame_Post();
|
|||
return 0; \
|
||||
} \
|
||||
} else { \
|
||||
if (x != 0 && FNullEnt(INDEXENT(x))) { \
|
||||
if (x != 0 && FNullEnt(TypeConversion.id_to_edict(x))) { \
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid entity %d", x); \
|
||||
return 0; \
|
||||
} \
|
||||
|
|
|
@ -25,7 +25,7 @@ int is_ent_valid(int iEnt)
|
|||
return 0;
|
||||
}
|
||||
} else {
|
||||
if (FNullEnt(INDEXENT(iEnt)))
|
||||
if (FNullEnt(TypeConversion.id_to_edict(iEnt)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -46,8 +46,8 @@ static cell AMX_NATIVE_CALL entity_range(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(idxa);
|
||||
CHECK_ENTITY(idxb);
|
||||
|
||||
edict_t *pEntA = INDEXENT2(idxa);
|
||||
edict_t *pEntB = INDEXENT2(idxb);
|
||||
edict_t *pEntA = TypeConversion.id_to_edict(idxa);
|
||||
edict_t *pEntB = TypeConversion.id_to_edict(idxb);
|
||||
|
||||
REAL fRet = (pEntA->v.origin - pEntB->v.origin).Length();
|
||||
|
||||
|
@ -64,7 +64,7 @@ static cell AMX_NATIVE_CALL call_think(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
MDLL_Think(pEnt);
|
||||
|
||||
|
@ -80,8 +80,8 @@ static cell AMX_NATIVE_CALL fake_touch(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(iPtr);
|
||||
CHECK_ENTITY(iPtd);
|
||||
|
||||
edict_t *pToucher = INDEXENT2(iPtr);
|
||||
edict_t *pTouched = INDEXENT2(iPtd);
|
||||
edict_t *pToucher = TypeConversion.id_to_edict(iPtr);
|
||||
edict_t *pTouched = TypeConversion.id_to_edict(iPtd);
|
||||
|
||||
MDLL_Touch(pToucher, pTouched);
|
||||
|
||||
|
@ -96,8 +96,8 @@ static cell AMX_NATIVE_CALL force_use(AMX *amx, cell *params)
|
|||
CHECK_ENTITY(iPtr);
|
||||
CHECK_ENTITY(iPtd);
|
||||
|
||||
edict_t *pUser = INDEXENT2(iPtr);
|
||||
edict_t *pUsed = INDEXENT2(iPtd);
|
||||
edict_t *pUser = TypeConversion.id_to_edict(iPtr);
|
||||
edict_t *pUsed = TypeConversion.id_to_edict(iPtd);
|
||||
|
||||
MDLL_Use(pUsed, pUser);
|
||||
|
||||
|
@ -126,7 +126,7 @@ static cell AMX_NATIVE_CALL remove_entity(AMX *amx, cell *params)
|
|||
return 0;
|
||||
}
|
||||
|
||||
edict_t *pEnt = INDEXENT2(id);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(id);
|
||||
|
||||
if (FNullEnt(pEnt))
|
||||
return 0;
|
||||
|
@ -158,7 +158,7 @@ static cell AMX_NATIVE_CALL DispatchKeyValue(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iValue);
|
||||
|
||||
edict_t *pEntity = INDEXENT2(iValue);
|
||||
edict_t *pEntity = TypeConversion.id_to_edict(iValue);
|
||||
KeyValueData kvd;
|
||||
int iLength=0;
|
||||
char *char1 = MF_GetAmxString(amx, params[2], 0, &iLength);
|
||||
|
@ -193,7 +193,7 @@ static cell AMX_NATIVE_CALL get_keyvalue(AMX *amx, cell *params)
|
|||
{
|
||||
int idx = params[1];
|
||||
CHECK_ENTITY(idx);
|
||||
edict_t *pEntity = INDEXENT2(idx);
|
||||
edict_t *pEntity = TypeConversion.id_to_edict(idx);
|
||||
int iLength=0;
|
||||
char *char1 = MF_GetAmxString(amx, params[2], 1, &iLength);
|
||||
char *val = INFO_KEY_VALUE(INFO_KEY_BUFFER(pEntity), char1);
|
||||
|
@ -221,7 +221,7 @@ static cell AMX_NATIVE_CALL DispatchSpawn(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
MDLL_Spawn(pEnt);
|
||||
|
||||
|
@ -240,7 +240,7 @@ static cell AMX_NATIVE_CALL entity_get_float(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -371,7 +371,7 @@ static cell AMX_NATIVE_CALL entity_set_float(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -502,7 +502,7 @@ static cell AMX_NATIVE_CALL entity_get_int(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -633,7 +633,7 @@ static cell AMX_NATIVE_CALL entity_set_int(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -765,7 +765,7 @@ static cell AMX_NATIVE_CALL entity_get_vector(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -862,7 +862,7 @@ static cell AMX_NATIVE_CALL entity_set_vector(AMX *amx, cell *params)
|
|||
REAL fY = amx_ctof(vAmx[1]);
|
||||
REAL fZ = amx_ctof(vAmx[2]);
|
||||
Vector vSet = Vector(fX, fY, fZ);
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -952,7 +952,7 @@ static cell AMX_NATIVE_CALL entity_get_string(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1014,7 +1014,7 @@ static cell AMX_NATIVE_CALL entity_set_string(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1073,7 +1073,7 @@ static cell AMX_NATIVE_CALL entity_get_edict2(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1139,8 +1139,8 @@ static cell AMX_NATIVE_CALL entity_set_edict(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pSetEnt = INDEXENT2(iSetEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
edict_t *pSetEnt = TypeConversion.id_to_edict(iSetEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1193,7 +1193,7 @@ static cell AMX_NATIVE_CALL entity_get_byte(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1236,7 +1236,7 @@ static cell AMX_NATIVE_CALL entity_set_byte(AMX *amx, cell *params)
|
|||
if(iNewValue < 0)
|
||||
iNewValue = 0;
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
switch (idx)
|
||||
{
|
||||
|
@ -1272,7 +1272,7 @@ static cell AMX_NATIVE_CALL entity_set_origin(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
cell *vVector = MF_GetAmxAddr(amx, params[2]);
|
||||
REAL fX = amx_ctof(vVector[0]);
|
||||
REAL fY = amx_ctof(vVector[1]);
|
||||
|
@ -1291,7 +1291,7 @@ static cell AMX_NATIVE_CALL entity_set_model(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
int iLen;
|
||||
char *szModel = MF_GetAmxString(amx, params[2], 0, &iLen);
|
||||
const char *szStatic = STRING(ALLOC_STRING(szModel));
|
||||
|
@ -1307,7 +1307,7 @@ static cell AMX_NATIVE_CALL entity_set_size(AMX *amx, cell *params)
|
|||
|
||||
CHECK_ENTITY_SIMPLE(iEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
|
||||
cell *cMin = MF_GetAmxAddr(amx, params[2]);
|
||||
REAL x1 = amx_ctof(cMin[0]);
|
||||
|
@ -1342,7 +1342,7 @@ static cell AMX_NATIVE_CALL find_ent_in_sphere(AMX *amx, cell *params)
|
|||
CHECK_ENTITY_SIMPLE(idx);
|
||||
}
|
||||
|
||||
edict_t *pEnt = INDEXENT2(idx);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(idx);
|
||||
cell *cAddr = MF_GetAmxAddr(amx, params[2]);
|
||||
float origin[3] = {
|
||||
amx_ctof(cAddr[0]),
|
||||
|
@ -1366,7 +1366,7 @@ static cell AMX_NATIVE_CALL find_ent_by_class(AMX *amx, cell *params) /* 3 param
|
|||
CHECK_ENTITY_SIMPLE(idx);
|
||||
}
|
||||
|
||||
edict_t *pEnt = INDEXENT2(idx);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(idx);
|
||||
|
||||
int len;
|
||||
char* sValue = MF_GetAmxString(amx, params[2], 0, &len);
|
||||
|
@ -1396,7 +1396,7 @@ static cell AMX_NATIVE_CALL find_sphere_class(AMX *amx, cell *params) // find_sp
|
|||
if (params[1] > 0) {
|
||||
CHECK_ENTITY(params[1]);
|
||||
|
||||
edict_t* pEntity = INDEXENT2(params[1]);
|
||||
edict_t* pEntity = TypeConversion.id_to_edict(params[1]);
|
||||
vecOrigin = pEntity->v.origin;
|
||||
} else {
|
||||
cell *cAddr = MF_GetAmxAddr(amx, params[6]);
|
||||
|
@ -1404,7 +1404,7 @@ static cell AMX_NATIVE_CALL find_sphere_class(AMX *amx, cell *params) // find_sp
|
|||
}
|
||||
|
||||
int entsFound = 0;
|
||||
edict_t* pSearchEnt = INDEXENT2(0);
|
||||
edict_t* pSearchEnt = TypeConversion.id_to_edict(0);
|
||||
|
||||
while (entsFound < params[5]) {
|
||||
pSearchEnt = FIND_ENTITY_IN_SPHERE(pSearchEnt, vecOrigin, radius); // takes const float origin
|
||||
|
@ -1435,7 +1435,7 @@ static cell AMX_NATIVE_CALL find_ent_by_target(AMX *amx, cell *params)
|
|||
if (!is_ent_valid(iStart))
|
||||
pStart = NULL;
|
||||
else
|
||||
pStart = INDEXENT2(iStart);
|
||||
pStart = TypeConversion.id_to_edict(iStart);
|
||||
}
|
||||
|
||||
int iReturnEnt = ENTINDEX(FIND_ENTITY_BY_TARGET(pStart, szValue));
|
||||
|
@ -1458,7 +1458,7 @@ static cell AMX_NATIVE_CALL find_ent_by_model(AMX *amx, cell *params) {
|
|||
if (!is_ent_valid(iStart))
|
||||
pStart = NULL;
|
||||
else
|
||||
pStart = INDEXENT2(iStart);
|
||||
pStart = TypeConversion.id_to_edict(iStart);
|
||||
}
|
||||
|
||||
edict_t *pEdict = FIND_ENTITY_BY_STRING(pStart, "classname", szClass);
|
||||
|
@ -1490,7 +1490,7 @@ static cell AMX_NATIVE_CALL find_ent_by_tname(AMX *amx, cell *params) {
|
|||
if (!is_ent_valid(iStart))
|
||||
pStart = NULL;
|
||||
else
|
||||
pStart = INDEXENT2(iStart);
|
||||
pStart = TypeConversion.id_to_edict(iStart);
|
||||
}
|
||||
|
||||
int iReturnEnt = ENTINDEX(FIND_ENTITY_BY_TARGETNAME(pStart, szValue));
|
||||
|
@ -1507,8 +1507,8 @@ static cell AMX_NATIVE_CALL find_ent_by_owner(AMX *amx, cell *params) // native
|
|||
}
|
||||
CHECK_ENTITY_SIMPLE(oEnt);
|
||||
|
||||
edict_t *pEnt = INDEXENT2(iEnt);
|
||||
edict_t *entOwner = INDEXENT2(oEnt);
|
||||
edict_t *pEnt = TypeConversion.id_to_edict(iEnt);
|
||||
edict_t *entOwner = TypeConversion.id_to_edict(oEnt);
|
||||
|
||||
//optional fourth parameter is for jghg2 compatibility
|
||||
const char* sCategory = NULL;
|
||||
|
@ -1546,8 +1546,8 @@ static cell AMX_NATIVE_CALL get_grenade_id(AMX *amx, cell *params) /* 4 param *
|
|||
|
||||
CHECK_ENTITY(index);
|
||||
|
||||
edict_t* pentFind = INDEXENT2(params[4]);
|
||||
edict_t* pentOwner = INDEXENT2(index);
|
||||
edict_t* pentFind = TypeConversion.id_to_edict(params[4]);
|
||||
edict_t* pentOwner = TypeConversion.id_to_edict(index);
|
||||
|
||||
pentFind = FIND_ENTITY_BY_CLASSNAME( pentFind, "grenade" );
|
||||
while (!FNullEnt(pentFind)) {
|
||||
|
@ -1575,7 +1575,7 @@ static cell AMX_NATIVE_CALL set_ent_rendering(AMX *amx, cell *params) // set_ent
|
|||
|
||||
CHECK_ENTITY_SIMPLE(params[1]);
|
||||
|
||||
edict_t *pEntity = INDEXENT2(params[1]);
|
||||
edict_t *pEntity = TypeConversion.id_to_edict(params[1]);
|
||||
|
||||
pEntity->v.renderfx = params[2];
|
||||
pEntity->v.rendercolor = Vector(float(params[3]), float(params[4]), float(params[5]));
|
||||
|
@ -1593,8 +1593,8 @@ static cell AMX_NATIVE_CALL entity_intersects(AMX *amx, cell *params) // bool:en
|
|||
CHECK_ENTITY_SIMPLE(params[1]);
|
||||
CHECK_ENTITY_SIMPLE(params[2]);
|
||||
|
||||
entvars_s *pevEntity = VARS(INDEXENT2(params[1]));
|
||||
entvars_s *pevOther = VARS(INDEXENT2(params[2]));
|
||||
entvars_s *pevEntity = VARS(TypeConversion.id_to_edict(params[1]));
|
||||
entvars_s *pevOther = VARS(TypeConversion.id_to_edict(params[2]));
|
||||
|
||||
if (pevOther->absmin.x > pevEntity->absmax.x ||
|
||||
pevOther->absmin.y > pevEntity->absmax.y ||
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
#define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
<ClCompile Include="..\..\..\public\sdk\amxxmodule.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\public\HLTypeConversion.h" />
|
||||
<ClInclude Include="..\..\..\public\memtools\CDetour\asm\asm.h" />
|
||||
<ClInclude Include="..\..\..\public\memtools\CDetour\detourhelpers.h" />
|
||||
<ClInclude Include="..\..\..\public\memtools\CDetour\detours.h" />
|
||||
|
|
|
@ -85,6 +85,9 @@
|
|||
<ClInclude Include="..\..\..\public\memtools\CDetour\asm\asm.h">
|
||||
<Filter>Memtools\CDetour\asm</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\public\HLTypeConversion.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\..\plugins\include\engine.inc">
|
||||
|
|
Loading…
Reference in New Issue
Block a user