Some minor changes:

Changed offsets from linux to windows.
Removed DispatchKeyValue forward.
This commit is contained in:
David Anderson 2004-05-26 07:54:01 +00:00
parent 86598d3582
commit 8b256eb8bb
2 changed files with 24 additions and 23 deletions

View File

@ -1,4 +1,4 @@
#include "engine.h" include "engine.h"
int AmxStringToEngine(AMX *amx, cell param, int &len) int AmxStringToEngine(AMX *amx, cell param, int &len)
{ {
@ -33,19 +33,18 @@ void OnAmxxAttach()
void OnPluginsLoaded() void OnPluginsLoaded()
{ {
pfnThinkForward = MF_RegisterForward("pfnThink", ET_STOP, FP_CELL, FP_DONE); pfnThinkForward = MF_RegisterForward("pfn_think", ET_STOP, FP_CELL, FP_DONE);
PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE); PlayerPreThinkForward = MF_RegisterForward("client_PreThink", ET_STOP, FP_CELL, FP_DONE);
PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE); PlayerPostThinkForward = MF_RegisterForward("client_PostThink", ET_STOP, FP_CELL, FP_DONE);
ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE); ClientKillForward = MF_RegisterForward("client_kill", ET_STOP, FP_CELL, FP_DONE);
CmdStartForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); CmdStartForward = MF_RegisterForward("client_impulse", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
StartFrameForward = MF_RegisterForward("ServerFrame", ET_IGNORE, FP_DONE); StartFrameForward = MF_RegisterForward("ServerFrame", ET_IGNORE, FP_DONE);
DispatchKeyForward = MF_RegisterForward("Dispatch_KeyVal", ET_STOP, FP_CELL, FP_DONE); // DispatchKeyForward = MF_RegisterForward("Dispatch_KeyVal", ET_STOP, FP_CELL, FP_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); 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);
ChangelevelForward = MF_RegisterForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE); ChangelevelForward = MF_RegisterForward("server_changelevel", ET_STOP, FP_STRING, FP_DONE);
SpawnForward = MF_RegisterForward("pfnSpawn", ET_IGNORE, FP_CELL, FP_DONE); SpawnForward = MF_RegisterForward("pfn_spawn", ET_IGNORE, FP_CELL, FP_DONE);
DispatchUseForward = MF_RegisterForward("pfnUse", ET_STOP, FP_CELL, FP_CELL, FP_DONE); DispatchUseForward = MF_RegisterForward("pfn_use", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
pfnTouchForward = MF_RegisterForward("pfnTouch", ET_STOP, FP_CELL, FP_CELL, FP_DONE); pfnTouchForward = MF_RegisterForward("pfn_touch", ET_STOP, FP_CELL, FP_CELL, FP_DONE);
MF_Log("pfnTouch Forward: %d", pfnTouchForward);
} }
qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen) qboolean Voice_SetClientListening(int iReceiver, int iSender, qboolean bListen)

View File

@ -1350,8 +1350,8 @@ static cell AMX_NATIVE_CALL get_offset_short(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
return *((short *)pEnt->pvPrivateData + off); return *((short *)pEnt->pvPrivateData + off);
@ -1368,8 +1368,8 @@ static cell AMX_NATIVE_CALL set_offset_short(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
*((short *)pEnt->pvPrivateData + off) = (short)params[3]; *((short *)pEnt->pvPrivateData + off) = (short)params[3];
@ -1388,8 +1388,8 @@ static cell AMX_NATIVE_CALL get_offset_char(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
char r = *((char *)pEnt->pvPrivateData + off); char r = *((char *)pEnt->pvPrivateData + off);
@ -1407,8 +1407,8 @@ static cell AMX_NATIVE_CALL set_offset_char(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
char data = params[3]; char data = params[3];
@ -1428,8 +1428,8 @@ static cell AMX_NATIVE_CALL get_offset_int(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
return *((int *)pEnt->pvPrivateData + off); return *((int *)pEnt->pvPrivateData + off);
@ -1446,8 +1446,8 @@ static cell AMX_NATIVE_CALL set_offset_int(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
*((int *)pEnt->pvPrivateData + off) = params[3]; *((int *)pEnt->pvPrivateData + off) = params[3];
@ -1466,8 +1466,8 @@ static cell AMX_NATIVE_CALL get_offset_float(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
REAL fRet = (REAL)(*((REAL*)pEnt->pvPrivateData + off)); REAL fRet = (REAL)(*((REAL*)pEnt->pvPrivateData + off));
@ -1486,8 +1486,8 @@ static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params)
} }
edict_t *pEnt = INDEXENT(idx); edict_t *pEnt = INDEXENT(idx);
#ifndef __linux__ #ifdef __linux__
off -= 5; off += 5;
#endif #endif
REAL fVal = amx_ctof(params[3]); REAL fVal = amx_ctof(params[3]);
@ -1770,6 +1770,8 @@ AMX_NATIVE_INFO ent_Natives[] = {
{"set_offset_char", set_offset_char}, {"set_offset_char", set_offset_char},
{"get_offset", get_offset_int}, {"get_offset", get_offset_int},
{"set_offset", set_offset_int}, {"set_offset", set_offset_int},
{"get_offset_int", get_offset_int},
{"set_offset_int", set_offset_int},
{"get_offset_float", get_offset_float}, {"get_offset_float", get_offset_float},
{"set_offset_float", set_offset_float}, {"set_offset_float", set_offset_float},
{"get_entity_pointer", get_entity_pointer}, {"get_entity_pointer", get_entity_pointer},