mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Null tabled some forwards
Removed pfnUse hook (pointless) Changed a couple native names
This commit is contained in:
parent
2a1ee3fd37
commit
c9a0a3f9be
@ -1,5 +1,7 @@
|
|||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
|
BOOL CheckForPublic(const char *publicname);
|
||||||
|
|
||||||
int AmxStringToEngine(AMX *amx, cell param, int &len)
|
int AmxStringToEngine(AMX *amx, cell param, int &len)
|
||||||
{
|
{
|
||||||
char *szString = MF_GetAmxString(amx, param, 0, &len);
|
char *szString = MF_GetAmxString(amx, param, 0, &len);
|
||||||
@ -29,20 +31,71 @@ void OnAmxxAttach()
|
|||||||
|
|
||||||
void OnPluginsLoaded()
|
void OnPluginsLoaded()
|
||||||
{
|
{
|
||||||
pfnThinkForward = MF_RegisterForward("pfn_think", ET_STOP, FP_CELL, FP_DONE);
|
g_CameraCount=0;
|
||||||
PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE);
|
pfnThinkForward = MF_RegisterForward("pfn_think", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE);
|
PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE);
|
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
CmdStartForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
|
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE);
|
CmdStartForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
DispatchKeyForward = MF_RegisterForward("Dispatch_KeyVal", ET_STOP, FP_CELL, FP_DONE);
|
StartFrameForward = MF_RegisterForward("server_frame", ET_IGNORE, FP_DONE); // done
|
||||||
PlaybackForward = MF_RegisterForward("PlaybackEvent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
DispatchKeyForward = MF_RegisterForward("pfn_keyvalue", ET_STOP, FP_CELL, FP_DONE); // done
|
||||||
ChangelevelForward = MF_RegisterForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE);
|
PlaybackForward = MF_RegisterForward("pfn_playbackevent", ET_STOP, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
SpawnForward = MF_RegisterForward("pfn_spawn", ET_IGNORE, FP_CELL, FP_DONE);
|
SpawnForward = MF_RegisterForward("pfn_spawn", ET_IGNORE, FP_CELL, FP_DONE); // done
|
||||||
DispatchUseForward = MF_RegisterForward("pfn_use", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
|
pfnTouchForward = MF_RegisterForward("pfn_touch", ET_STOP, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
pfnTouchForward = MF_RegisterForward("pfn_touch", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
|
VexdTouchForward = MF_RegisterForward("vexd_pfntouch", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE); // done
|
||||||
VexdTouchForward = MF_RegisterForward("vexd_pfntouch", ET_IGNORE, FP_CELL, FP_CELL, FP_DONE);
|
VexdServerForward = MF_RegisterForward("ServerFrame", ET_IGNORE, FP_DONE); // done
|
||||||
VexdServerForward = MF_RegisterForward("ServerFrame", ET_IGNORE, FP_DONE);
|
// Reset all standard engine callbacks
|
||||||
|
|
||||||
|
// These will be reset through native calls, if need be
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnAddToFullPack=NULL;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnKeyValue=NULL;
|
||||||
|
if (CheckForPublic("pfn_keyvalue"))
|
||||||
|
g_pFunctionTable->pfnKeyValue=KeyValue;
|
||||||
|
|
||||||
|
g_pengfuncsTable->pfnPlaybackEvent=NULL; // "pfn_playbackevent"
|
||||||
|
if (CheckForPublic("pfn_playbackevent"))
|
||||||
|
g_pengfuncsTable->pfnPlaybackEvent=PlaybackEvent;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnPlayerPreThink=NULL; // "client_PreThink"
|
||||||
|
if (CheckForPublic("client_PreThink"))
|
||||||
|
g_pFunctionTable->pfnPlayerPreThink=PlayerPreThink;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnPlayerPostThink=NULL; // "client_PostThink"
|
||||||
|
if (CheckForPublic("client_PostThink"))
|
||||||
|
g_pFunctionTable->pfnPlayerPostThink=PlayerPostThink_Post;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnSpawn=NULL; // "pfn_spawn"
|
||||||
|
if (CheckForPublic("pfn_spawn"))
|
||||||
|
g_pFunctionTable->pfnSpawn=Spawn;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnClientKill=NULL; // "client_kill"
|
||||||
|
if (CheckForPublic("client_kill"))
|
||||||
|
g_pFunctionTable->pfnClientKill=ClientKill;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnCmdStart=NULL; // "client_impulse","register_impulse"
|
||||||
|
if (CheckForPublic("client_impulse"))
|
||||||
|
g_pFunctionTable->pfnCmdStart=CmdStart;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnThink=NULL; // "pfn_think", "register_think"
|
||||||
|
if (CheckForPublic("pfn_think"))
|
||||||
|
g_pFunctionTable->pfnThink=Think;
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnStartFrame=NULL; // "server_frame","ServerFrame"
|
||||||
|
if (CheckForPublic("server_frame"))
|
||||||
|
g_pFunctionTable->pfnStartFrame=StartFrame;
|
||||||
|
|
||||||
|
if (CheckForPublic("ServerFrame"))
|
||||||
|
g_pFunctionTable->pfnStartFrame=StartFrame;
|
||||||
|
|
||||||
|
|
||||||
|
g_pFunctionTable->pfnTouch=NULL; // "pfn_touch","vexd_pfntouch"
|
||||||
|
if (CheckForPublic("pfn_touch"))
|
||||||
|
g_pFunctionTable->pfnTouch=pfnTouch;
|
||||||
|
|
||||||
|
if (CheckForPublic("vexd_pfntouch"))
|
||||||
|
g_pFunctionTable->pfnTouch=pfnTouch;
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen)
|
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen)
|
||||||
@ -67,6 +120,7 @@ qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen)
|
|||||||
|
|
||||||
int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet)
|
int AddToFullPack(struct entity_state_s *state, int e, edict_t *ent, edict_t *host, int hostflags, int player, unsigned char *pSet)
|
||||||
{
|
{
|
||||||
|
sprintf("%s called\n",__FUNCTION__);
|
||||||
if(ent == host) {
|
if(ent == host) {
|
||||||
if(FStrEq(STRING(ent->v.classname), "player")) {
|
if(FStrEq(STRING(ent->v.classname), "player")) {
|
||||||
if(plinfo[ENTINDEX(ent)].iViewType != CAMERA_NONE) {
|
if(plinfo[ENTINDEX(ent)].iViewType != CAMERA_NONE) {
|
||||||
@ -91,6 +145,15 @@ void ClientDisconnect(edict_t *pEntity)
|
|||||||
{
|
{
|
||||||
int id = ENTINDEX(pEntity);
|
int id = ENTINDEX(pEntity);
|
||||||
|
|
||||||
|
if (plinfo[ENTINDEX(pEntity)].iViewType != CAMERA_NONE) // Verify that they were originally in a modified view
|
||||||
|
{
|
||||||
|
g_CameraCount--;
|
||||||
|
if (g_CameraCount < 0)
|
||||||
|
g_CameraCount=0;
|
||||||
|
if (g_CameraCount==0)
|
||||||
|
g_pFunctionTable->pfnAddToFullPack=AddToFullPack;
|
||||||
|
}
|
||||||
|
|
||||||
plinfo[id].iSpeakFlags = SPEAK_NORMAL;
|
plinfo[id].iSpeakFlags = SPEAK_NORMAL;
|
||||||
plinfo[id].iViewType = CAMERA_NONE;
|
plinfo[id].iViewType = CAMERA_NONE;
|
||||||
plinfo[id].iRenderMode = 0;
|
plinfo[id].iRenderMode = 0;
|
||||||
@ -152,3 +215,24 @@ void LightStyle(int style, char *val) {
|
|||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL CheckForPublic(const char *publicname)
|
||||||
|
{
|
||||||
|
AMX* amx;
|
||||||
|
char blah[64];
|
||||||
|
strncpy(blah,publicname,63);
|
||||||
|
int iFunctionIndex;
|
||||||
|
int i=0;
|
||||||
|
// Loop through all running scripts
|
||||||
|
while((amx=MF_GetScriptAmx(i++))!=NULL)
|
||||||
|
{
|
||||||
|
// Scan for public
|
||||||
|
if (MF_AmxFindPublic(amx, blah, &iFunctionIndex) == AMX_ERR_NONE)
|
||||||
|
{
|
||||||
|
// Public was found.
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE; // no public found in any loaded script
|
||||||
|
}
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
* Description: AMX Mod X Module Interface Functions
|
* Description: AMX Mod X Module Interface Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -45,6 +47,13 @@
|
|||||||
enginefuncs_t g_engfuncs;
|
enginefuncs_t g_engfuncs;
|
||||||
globalvars_t *gpGlobals;
|
globalvars_t *gpGlobals;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
enginefuncs_t *g_pengfuncsTable;
|
||||||
|
enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
|
||||||
// GetEntityAPI2 functions
|
// GetEntityAPI2 functions
|
||||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||||
{
|
{
|
||||||
@ -2114,6 +2123,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||||
|
g_pFunctionTable=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2131,7 +2141,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||||
|
g_pFunctionTable_Post=pFunctionTable;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2154,6 +2164,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2171,6 +2182,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
|||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||||
|
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -20,6 +20,11 @@
|
|||||||
|
|
||||||
#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT(x)) || x < 0 || x > gpGlobals->maxEntities)) { MF_RaiseAmxError(amx,AMX_ERR_NATIVE); return 0; }
|
#define CHECK_ENTITY(x) if (x != 0 && (FNullEnt(INDEXENT(x)) || x < 0 || x > gpGlobals->maxEntities)) { MF_RaiseAmxError(amx,AMX_ERR_NATIVE); return 0; }
|
||||||
|
|
||||||
|
extern DLL_FUNCTIONS *g_pFunctionTable;
|
||||||
|
extern DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||||
|
extern enginefuncs_t *g_pengfuncsTable;
|
||||||
|
extern enginefuncs_t *g_pengfuncsTable_Post;
|
||||||
|
|
||||||
extern int SpawnForward;
|
extern int SpawnForward;
|
||||||
extern int ChangelevelForward;
|
extern int ChangelevelForward;
|
||||||
extern int PlaybackForward;
|
extern int PlaybackForward;
|
||||||
@ -79,134 +84,6 @@ enum
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
|
||||||
EngFunc_PrecacheModel, // int ) (char* s);
|
|
||||||
EngFunc_PrecacheSound, // int ) (char* s);
|
|
||||||
EngFunc_SetModel, // void ) (edict_t *e, const char *m);
|
|
||||||
EngFunc_ModelIndex, // int ) (const char *m);
|
|
||||||
EngFunc_ModelFrames, // int ) (int modelIndex);
|
|
||||||
EngFunc_SetSize, // void ) (edict_t *e, const float *rgflMin, const float *rgflMax);
|
|
||||||
EngFunc_ChangeLevel, // void ) (char* s1, char* s2);
|
|
||||||
EngFunc_VecToYaw, // float) (const float *rgflVector);
|
|
||||||
EngFunc_VecToAngles, // void ) (const float *rgflVectorIn, float *rgflVectorOut);
|
|
||||||
EngFunc_MoveToOrigin, // void ) (edict_t *ent, const float *pflGoal, float dist, int iMoveType);
|
|
||||||
EngFunc_ChangeYaw, // void ) (edict_t* ent);
|
|
||||||
EngFunc_ChangePitch, // void ) (edict_t* ent);
|
|
||||||
EngFunc_FindEntityByString, // edict) (edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue);
|
|
||||||
EngFunc_GetEntityIllum, // int ) (edict_t* pEnt);
|
|
||||||
EngFunc_FindEntityInSphere, // edict) (edict_t *pEdictStartSearchAfter, const float *org, float rad);
|
|
||||||
EngFunc_FindClientInPVS, // edict) (edict_t *pEdict);
|
|
||||||
EngFunc_EntitiesInPVS, // edict) (edict_t *pplayer);
|
|
||||||
EngFunc_MakeVectors, // void ) (const float *rgflVector);
|
|
||||||
EngFunc_AngleVectors, // void ) (const float *rgflVector, float *forward, float *right, float *up);
|
|
||||||
EngFunc_CreateEntity, // edict) (void);
|
|
||||||
EngFunc_RemoveEntity, // void ) (edict_t* e);
|
|
||||||
EngFunc_CreateNamedEntity, // edict) (int className);
|
|
||||||
EngFunc_MakeStatic, // void ) (edict_t *ent);
|
|
||||||
EngFunc_EntIsOnFloor, // int ) (edict_t *e);
|
|
||||||
EngFunc_DropToFloor, // int ) (edict_t* e);
|
|
||||||
EngFunc_WalkMove, // int ) (edict_t *ent, float yaw, float dist, int iMode);
|
|
||||||
EngFunc_SetOrigin, // void ) (edict_t *e, const float *rgflOrigin);
|
|
||||||
EngFunc_EmitSound, // void ) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch);
|
|
||||||
EngFunc_EmitAmbientSound, // void ) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch);
|
|
||||||
EngFunc_TraceLine, // void ) (const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
|
|
||||||
EngFunc_TraceToss, // void ) (edict_t* pent, edict_t* pentToIgnore, TraceResult *ptr);
|
|
||||||
EngFunc_TraceMonsterHull, // int ) (edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr);
|
|
||||||
EngFunc_TraceHull, // void ) (const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr);
|
|
||||||
EngFunc_TraceModel, // void ) (const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr);
|
|
||||||
EngFunc_TraceTexture, // const char *) (edict_t *pTextureEntity, const float *v1, const float *v2 );
|
|
||||||
EngFunc_TraceSphere, // void ) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr);
|
|
||||||
EngFunc_GetAimVector, // void ) (edict_t* ent, float speed, float *rgflReturn);
|
|
||||||
EngFunc_ParticleEffect, // void ) (const float *org, const float *dir, float color, float count);
|
|
||||||
EngFunc_LightStyle, // void ) (int style, char* val);
|
|
||||||
EngFunc_DecalIndex, // int ) (const char *name);
|
|
||||||
EngFunc_PointContents, // int ) (const float *rgflVector);
|
|
||||||
EngFunc_FreeEntPrivateData, // void ) (edict_t *pEdict);
|
|
||||||
EngFunc_SzFromIndex, // const char * ) (int iString);
|
|
||||||
EngFunc_AllocString, // int ) (const char *szValue);
|
|
||||||
EngFunc_RegUserMsg, // int ) (const char *pszName, int iSize);
|
|
||||||
EngFunc_AnimationAutomove, // void ) (const edict_t* pEdict, float flTime);
|
|
||||||
EngFunc_GetBonePosition, // void ) (const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles );
|
|
||||||
EngFunc_GetAttachment, // void ) (const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles );
|
|
||||||
EngFunc_SetView, // void ) (const edict_t *pClient, const edict_t *pViewent );
|
|
||||||
EngFunc_Time, // float) ( void );
|
|
||||||
EngFunc_CrosshairAngle, // void ) (const edict_t *pClient, float pitch, float yaw);
|
|
||||||
EngFunc_FadeClientVolume, // void ) (const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds);
|
|
||||||
EngFunc_SetClientMaxspeed, // void ) (const edict_t *pEdict, float fNewMaxspeed);
|
|
||||||
EngFunc_CreateFakeClient, // edict) (const char *netname); // returns NULL if fake client can't be created
|
|
||||||
EngFunc_RunPlayerMove, // void ) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec );
|
|
||||||
EngFunc_NumberOfEntities, // int ) (void);
|
|
||||||
EngFunc_StaticDecal, // void ) ( const float *origin, int decalIndex, int entityIndex, int modelIndex );
|
|
||||||
EngFunc_PrecacheGeneric, // int ) (char* s);
|
|
||||||
EngFunc_BuildSoundMsg, // void ) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed);
|
|
||||||
EngFunc_GetPhysicsKeyValue, // const char* ) ( const edict_t *pClient, const char *key );
|
|
||||||
EngFunc_SetPhysicsKeyValue, // void ) ( const edict_t *pClient, const char *key, const char *value );
|
|
||||||
EngFunc_GetPhysicsInfoString,// const char* ) ( const edict_t *pClient );
|
|
||||||
EngFunc_PrecacheEvent, // unsigned short ) ( int type, const char*psz );
|
|
||||||
EngFunc_PlaybackEvent, // void ) ( 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 );
|
|
||||||
EngFunc_CheckVisibility, //) ( const edict_t *entity, unsigned char *pset );
|
|
||||||
EngFunc_GetCurrentPlayer, //) ( void );
|
|
||||||
EngFunc_CanSkipPlayer, //) ( const edict_t *player );
|
|
||||||
EngFunc_SetGroupMask, //) ( int mask, int op );
|
|
||||||
EngFunc_GetClientListening, // bool (int iReceiver, int iSender)
|
|
||||||
EngFunc_SetClientListening, // bool (int iReceiver, int iSender, bool Listen)
|
|
||||||
EngFunc_MessageBegin, // void (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed)
|
|
||||||
EngFunc_WriteCoord, // void (float)
|
|
||||||
EngFunc_WriteAngle, // void (float)
|
|
||||||
EngFunc_InfoKeyValue, // char* ) (char *infobuffer, char *key);
|
|
||||||
EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value);
|
|
||||||
EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value);
|
|
||||||
};
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
DLLFunc_GameInit, // void) ( void );
|
|
||||||
DLLFunc_Spawn, // int ) ( edict_t *pent );
|
|
||||||
DLLFunc_Think, // void ) ( edict_t *pent );
|
|
||||||
DLLFunc_Use, // void ) ( edict_t *pentUsed, edict_t *pentOther );
|
|
||||||
DLLFunc_Touch, // void ) ( edict_t *pentTouched, edict_t *pentOther );
|
|
||||||
DLLFunc_Blocked, // void ) ( edict_t *pentBlocked, edict_t *pentOther );
|
|
||||||
DLLFunc_KeyValue, // void ) ( edict_t *pentKeyvalue, KeyValueData *pkvd );
|
|
||||||
DLLFunc_SetAbsBox, // void ) ( edict_t *pent );
|
|
||||||
DLLFunc_ClientConnect, // bool) ( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
|
|
||||||
|
|
||||||
DLLFunc_ClientDisconnect, // void ) ( edict_t *pEntity );
|
|
||||||
DLLFunc_ClientKill, // void ) ( edict_t *pEntity );
|
|
||||||
DLLFunc_ClientPutInServer, // void ) ( edict_t *pEntity );
|
|
||||||
DLLFunc_ClientCommand, // void ) ( edict_t *pEntity );
|
|
||||||
|
|
||||||
DLLFunc_ServerDeactivate, // void) ( void );
|
|
||||||
|
|
||||||
DLLFunc_PlayerPreThink, // void ) ( edict_t *pEntity );
|
|
||||||
DLLFunc_PlayerPostThink, // void ) ( edict_t *pEntity );
|
|
||||||
|
|
||||||
DLLFunc_StartFrame, // void ) ( void );
|
|
||||||
DLLFunc_ParmsNewLevel, // void ) ( void );
|
|
||||||
DLLFunc_ParmsChangeLevel, // void ) ( void );
|
|
||||||
|
|
||||||
// Returns string describing current .dll. E.g., TeamFotrress 2, Half-Life
|
|
||||||
DLLFunc_GetGameDescription, // const char * )( void );
|
|
||||||
|
|
||||||
// Spectator funcs
|
|
||||||
DLLFunc_SpectatorConnect, // void) ( edict_t *pEntity );
|
|
||||||
DLLFunc_SpectatorDisconnect, // void ) ( edict_t *pEntity );
|
|
||||||
DLLFunc_SpectatorThink, // void ) ( edict_t *pEntity );
|
|
||||||
|
|
||||||
// Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint.
|
|
||||||
DLLFunc_Sys_Error, // void ) ( const char *error_string );
|
|
||||||
|
|
||||||
DLLFunc_PM_FindTextureType, // char )( char *name );
|
|
||||||
DLLFunc_RegisterEncoders, // void ) ( void );
|
|
||||||
|
|
||||||
// Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise
|
|
||||||
DLLFunc_GetHullBounds, // int) ( int hullnumber, float *mins, float *maxs );
|
|
||||||
|
|
||||||
// Create baselines for certain "unplaced" items.
|
|
||||||
DLLFunc_CreateInstancedBaselines, // void ) ( void );
|
|
||||||
DLLFunc_pfnAllowLagCompensation, // int )( void );
|
|
||||||
// I know this does not fit with DLLFUNC(), but I dont want another native just for it.
|
|
||||||
MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev);
|
|
||||||
};
|
|
||||||
|
|
||||||
// Used by the traceresult() native.
|
// Used by the traceresult() native.
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@ -289,6 +166,8 @@ int is_ent_valid(int iEnt);
|
|||||||
int AmxStringToEngine(AMX *amx, cell param, int &len);
|
int AmxStringToEngine(AMX *amx, cell param, int &len);
|
||||||
edict_t *UTIL_FindEntityInSphere(edict_t *pStart, const Vector &vecCenter, float flRadius);
|
edict_t *UTIL_FindEntityInSphere(edict_t *pStart, const Vector &vecCenter, float flRadius);
|
||||||
|
|
||||||
|
extern int g_CameraCount;
|
||||||
|
|
||||||
extern bool g_inKeyValue;
|
extern bool g_inKeyValue;
|
||||||
extern KeyValueData *g_pkvd;
|
extern KeyValueData *g_pkvd;
|
||||||
extern bool incmd;
|
extern bool incmd;
|
||||||
@ -298,7 +177,6 @@ extern struct GlobalInfo glinfo;
|
|||||||
extern AMX_NATIVE_INFO engine_Natives[];
|
extern AMX_NATIVE_INFO engine_Natives[];
|
||||||
extern CVector<Impulse *> Impulses;
|
extern CVector<Impulse *> Impulses;
|
||||||
extern CVector<EntClass *> Thinks;
|
extern CVector<EntClass *> Thinks;
|
||||||
extern CVector<EntClass *> Uses;
|
|
||||||
extern CVector<Touch *> Touches;
|
extern CVector<Touch *> Touches;
|
||||||
|
|
||||||
#endif //_ENGINE_INCLUDE_H
|
#endif //_ENGINE_INCLUDE_H
|
@ -19,6 +19,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""c:\Documents and Settings\Steve\My Documents\include\metamod";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\common";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\engine";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\dlls";"c:\Documents and Settings\Steve\My Documents\include\HLSDKMP\pm_shared""
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
|
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;ENGINE_EXPORTS"
|
||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
|
@ -17,7 +17,6 @@ int VexdTouchForward = 0;
|
|||||||
int VexdServerForward = 0;
|
int VexdServerForward = 0;
|
||||||
CVector<Impulse *> Impulses;
|
CVector<Impulse *> Impulses;
|
||||||
CVector<EntClass *> Thinks;
|
CVector<EntClass *> Thinks;
|
||||||
CVector<EntClass *> Uses;
|
|
||||||
CVector<Touch *> Touches;
|
CVector<Touch *> Touches;
|
||||||
KeyValueData *g_pkvd;
|
KeyValueData *g_pkvd;
|
||||||
bool g_inKeyValue=false;
|
bool g_inKeyValue=false;
|
||||||
@ -37,20 +36,7 @@ int fstrcmp(const char *s1, const char *s2)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DispatchUse(edict_t *pentUsed, edict_t *pentOther)
|
int Spawn(edict_t *pEntity) {
|
||||||
{
|
|
||||||
if (DispatchUseForward) {
|
|
||||||
int retVal = 0;
|
|
||||||
int used = ENTINDEX(pentUsed);
|
|
||||||
int user = ENTINDEX(pentOther);
|
|
||||||
retVal = MF_ExecuteForward(DispatchUseForward, user, used);
|
|
||||||
if (retVal)
|
|
||||||
RETURN_META(MRES_SUPERCEDE);
|
|
||||||
}
|
|
||||||
RETURN_META(MRES_IGNORED);
|
|
||||||
}
|
|
||||||
|
|
||||||
int DispatchSpawn(edict_t *pEntity) {
|
|
||||||
if (SpawnForward) {
|
if (SpawnForward) {
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
int id = ENTINDEX(pEntity);
|
int id = ENTINDEX(pEntity);
|
||||||
@ -116,7 +102,7 @@ void KeyValue(edict_t *pEntity, KeyValueData *pkvd)
|
|||||||
RETURN_META(MRES_HANDLED);
|
RETURN_META(MRES_HANDLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartFrame_Post()
|
void StartFrame()
|
||||||
{
|
{
|
||||||
if (glinfo.bCheckLights) {
|
if (glinfo.bCheckLights) {
|
||||||
if (!FStrEq((const char*)glinfo.szLastLights, "")) {
|
if (!FStrEq((const char*)glinfo.szLastLights, "")) {
|
||||||
@ -176,13 +162,11 @@ void ClientKill(edict_t *pEntity)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerPreThink_Post(edict_t *pEntity)
|
void PlayerPreThink(edict_t *pEntity)
|
||||||
{
|
{
|
||||||
MF_ExecuteForward(PlayerPreThinkForward, ENTINDEX(pEntity));
|
MF_ExecuteForward(PlayerPreThinkForward, ENTINDEX(pEntity));
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlayerPostThink_Post(edict_t *pEntity)
|
void PlayerPostThink_Post(edict_t *pEntity)
|
||||||
{
|
{
|
||||||
if(plinfo[ENTINDEX(pEntity)].pViewEnt) {
|
if(plinfo[ENTINDEX(pEntity)].pViewEnt) {
|
||||||
@ -222,12 +206,16 @@ void PlayerPostThink_Post(edict_t *pEntity)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MF_ExecuteForward(PlayerPostThinkForward, ENTINDEX(pEntity));
|
if (PlayerPostThinkForward)
|
||||||
|
{
|
||||||
|
if (MF_ExecuteForward(PlayerPostThinkForward, ENTINDEX(pEntity)))
|
||||||
|
RETURN_META(MRES_SUPERCEDE);
|
||||||
|
}
|
||||||
|
|
||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DispatchTouch(edict_t *pToucher, edict_t *pTouched)
|
void pfnTouch(edict_t *pToucher, edict_t *pTouched)
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
@ -282,7 +270,7 @@ void DispatchTouch(edict_t *pToucher, edict_t *pTouched)
|
|||||||
RETURN_META(MRES_IGNORED);
|
RETURN_META(MRES_IGNORED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DispatchThink_Post(edict_t *pent)
|
void Think(edict_t *pent)
|
||||||
{
|
{
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
const char *cls = STRING(pent->v.classname);
|
const char *cls = STRING(pent->v.classname);
|
||||||
|
@ -54,12 +54,12 @@
|
|||||||
// (wd) are Will Day's notes
|
// (wd) are Will Day's notes
|
||||||
// - GetEntityAPI2 functions
|
// - GetEntityAPI2 functions
|
||||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||||
#define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
#define FN_DispatchSpawn Spawn /* pfnSpawn() */
|
||||||
//#define FN_DispatchThink DispatchThink /* pfnThink() */
|
#define FN_DispatchThink Think /* pfnThink() */
|
||||||
#define FN_DispatchUse DispatchUse /* pfnUse() */
|
// #define FN_DispatchUse Use /* pfnUse() */
|
||||||
#define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
#define FN_DispatchTouch pfnTouch /* pfnTouch() */
|
||||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||||
//#define FN_DispatchKeyValue KeyValue /* pfnKeyValue() */
|
#define FN_DispatchKeyValue KeyValue /* pfnKeyValue() */
|
||||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||||
@ -76,9 +76,9 @@
|
|||||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
// #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_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||||
//#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||||
//#define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||||
//#define FN_StartFrame StartFrame /* pfnStartFrame() */
|
#define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||||
@ -107,7 +107,7 @@
|
|||||||
// - GetEntityAPI2_Post functions
|
// - GetEntityAPI2_Post functions
|
||||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||||
#define FN_DispatchThink_Post DispatchThink_Post
|
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||||
@ -128,9 +128,9 @@
|
|||||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||||
#define FN_PlayerPreThink_Post PlayerPreThink_Post
|
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||||
#define FN_PlayerPostThink_Post PlayerPostThink_Post
|
#define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||||
#define FN_StartFrame_Post StartFrame_Post
|
// #define FN_StartFrame_Post StartFrame_Post
|
||||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||||
@ -163,7 +163,7 @@
|
|||||||
// #define FN_ModelIndex ModelIndex
|
// #define FN_ModelIndex ModelIndex
|
||||||
// #define FN_ModelFrames ModelFrames
|
// #define FN_ModelFrames ModelFrames
|
||||||
// #define FN_SetSize SetSize
|
// #define FN_SetSize SetSize
|
||||||
#define FN_ChangeLevel ChangeLevel
|
// #define FN_ChangeLevel ChangeLevel
|
||||||
// #define FN_GetSpawnParms GetSpawnParms
|
// #define FN_GetSpawnParms GetSpawnParms
|
||||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||||
// #define FN_VecToYaw VecToYaw
|
// #define FN_VecToYaw VecToYaw
|
||||||
|
Loading…
Reference in New Issue
Block a user