Update globally Hamsandwich module (bug 5611, r=sawce)

This commit is contained in:
Arkshine 2014-04-09 16:35:46 +02:00
parent 9815050287
commit 1a7daad657
29 changed files with 17823 additions and 11404 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -282,6 +282,191 @@ static cell AMX_NATIVE_CALL SetHamParamString(AMX *amx, cell *params)
int ret=dat->SetString(MF_GetAmxAddr(amx, params[2])); int ret=dat->SetString(MF_GetAmxAddr(amx, params[2]));
PARSE_RETURN(); PARSE_RETURN();
} }
static cell AMX_NATIVE_CALL SetHamParamItemInfo(AMX *amx, cell *params)
{
if (params[2] == 0)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle provided.");
return 0;
}
CHECK_STACK(ParamStack);
CVector<Data *> *vec = ParamStack.front();
if (vec->size() < (unsigned)params[1])
{
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid parameter number, got %d, expected %d", params[1], vec->size());
return 0;
}
Data *dat = vec->at(params[1] - 1);
int ret = dat->SetInt(&params[2]);
PARSE_RETURN();
}
static cell AMX_NATIVE_CALL GetHamItemInfo(AMX *amx, cell *params)
{
if (params[1] == 0)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Null iteminfo handle provided.");
return 0;
}
int type = params[2];
if ((type == ItemInfo_pszAmmo1 || type == ItemInfo_pszAmmo2 || type == ItemInfo_pszName) && (*params / sizeof(cell)) != 4)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Bad arg count. Expected %d, got %d.", 4, *params / sizeof(cell));
return 0;
}
ItemInfo *pItem = reinterpret_cast<ItemInfo *>(params[1]);
switch (type)
{
case ItemInfo_iSlot:
return pItem->iSlot;
case ItemInfo_iPosition:
return pItem->iPosition;
case ItemInfo_pszAmmo1:
return MF_SetAmxString( amx, params[3], pItem->pszAmmo1 > 0 ? pItem->pszAmmo1 : "", params[4] );
case ItemInfo_iMaxAmmo1:
return pItem->iMaxAmmo1;
case ItemInfo_pszAmmo2:
return MF_SetAmxString( amx, params[3], pItem->pszAmmo2 > 0 ? pItem->pszAmmo2 : "", params[4] );
case ItemInfo_iMaxAmmo2:
return pItem->iMaxAmmo2;
case ItemInfo_pszName:
return MF_SetAmxString( amx, params[3], pItem->pszName > 0 ? pItem->pszName : "", params[4] );
case ItemInfo_iMaxClip:
return pItem->iMaxClip;
case ItemInfo_iId:
return pItem->iId;
case ItemInfo_iFlags:
return pItem->iFlags;
case ItemInfo_iWeight:
return pItem->iWeight;
}
MF_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", type);
return 0;
}
CStack<ItemInfo *> g_FreeIIs;
static cell AMX_NATIVE_CALL CreateHamItemInfo(AMX *amx, cell *params)
{
ItemInfo *ii;
if (g_FreeIIs.empty())
{
ii = new ItemInfo;
}
else
{
ii = g_FreeIIs.front();
g_FreeIIs.pop();
}
memset(ii, 0, sizeof(ItemInfo));
return reinterpret_cast<cell>(ii);
}
static cell AMX_NATIVE_CALL FreeHamItemInfo(AMX *amx, cell *params)
{
ItemInfo *ii = reinterpret_cast<ItemInfo *>(params[1]);
if (!ii)
{
return 0;
}
g_FreeIIs.push(ii);
return 1;
}
static cell AMX_NATIVE_CALL SetHamItemInfo(AMX *amx, cell *params)
{
if (params[1] == 0)
{
MF_LogError(amx, AMX_ERR_NATIVE, "Null iteminfo handle provided.");
return 0;
}
ItemInfo *pItem = reinterpret_cast<ItemInfo *>(params[1]);
cell *ptr = MF_GetAmxAddr(amx, params[3]);
int iLen;
switch (params[2])
{
case ItemInfo_iSlot:
pItem->iSlot = *ptr;
break;
case ItemInfo_iPosition:
pItem->iPosition = *ptr;
break;
case ItemInfo_pszAmmo1:
pItem->pszAmmo1 = MF_GetAmxString(amx, params[3], 0, &iLen);
return iLen;
case ItemInfo_iMaxAmmo1:
pItem->iMaxAmmo1 = *ptr;
break;
case ItemInfo_pszAmmo2:
pItem->pszAmmo2 = MF_GetAmxString(amx, params[3], 0, &iLen);
return iLen;
case ItemInfo_iMaxAmmo2:
pItem->iMaxAmmo2 = *ptr;
break;
case ItemInfo_pszName:
pItem->pszName = MF_GetAmxString(amx, params[3], 0, &iLen);
return iLen;
case ItemInfo_iMaxClip:
pItem->iMaxClip = *ptr;
break;
case ItemInfo_iId:
pItem->iId = *ptr;
break;
case ItemInfo_iFlags:
pItem->iFlags = *ptr;
break;
case ItemInfo_iWeight:
pItem->iWeight = *ptr;
break;
default:
MF_LogError(amx, AMX_ERR_NATIVE, "Unknown ItemInfo type %d", params[2]);
return 0;
}
return 1;
}
static cell AMX_NATIVE_CALL GetHamReturnStatus(AMX *amx, cell *params) static cell AMX_NATIVE_CALL GetHamReturnStatus(AMX *amx, cell *params)
{ {
CHECK_STACK(ReturnStatus); CHECK_STACK(ReturnStatus);
@ -316,6 +501,12 @@ AMX_NATIVE_INFO ReturnNatives[] =
{ "SetHamParamEntity", SetHamParamEntity }, { "SetHamParamEntity", SetHamParamEntity },
{ "SetHamParamString", SetHamParamString }, { "SetHamParamString", SetHamParamString },
{ "SetHamParamTraceResult", SetHamParamTraceResult }, { "SetHamParamTraceResult", SetHamParamTraceResult },
{ "SetHamParamItemInfo", SetHamParamItemInfo },
{ "GetHamItemInfo", GetHamItemInfo },
{ "SetHamItemInfo", SetHamItemInfo },
{ "CreateHamItemInfo", CreateHamItemInfo },
{ "FreeHamItemInfo", FreeHamItemInfo },
{ NULL, NULL }, { NULL, NULL },
}; };

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -37,15 +37,50 @@
enum enum
{ {
RET_VOID, RET_VOID,
RET_BOOL,
RET_INTEGER, RET_INTEGER,
RET_SHORT,
RET_FLOAT, RET_FLOAT,
RET_VECTOR, RET_VECTOR,
RET_STRING, RET_STRING,
RET_CBASE, RET_CBASE,
RET_ENTVAR, RET_ENTVAR,
RET_EDICT,
RET_TRACE, RET_TRACE,
RET_ITEMINFO RET_ITEMINFO
}; };
typedef struct
{
int iSlot;
int iPosition;
const char *pszAmmo1;
int iMaxAmmo1;
const char *pszAmmo2;
int iMaxAmmo2;
const char *pszName;
int iMaxClip;
int iId;
int iFlags;
int iWeight;
}
ItemInfo;
enum
{
ItemInfo_iSlot,
ItemInfo_iPosition,
ItemInfo_pszAmmo1,
ItemInfo_iMaxAmmo1,
ItemInfo_pszAmmo2,
ItemInfo_iMaxAmmo2,
ItemInfo_pszName,
ItemInfo_iMaxClip,
ItemInfo_iId,
ItemInfo_iFlags,
ItemInfo_iWeight
};
// Container for return and parameter data. // Container for return and parameter data.
// Contains a void pointer, and a flag telling what it contains. // Contains a void pointer, and a flag telling what it contains.
class Data class Data
@ -97,6 +132,21 @@ public:
*(reinterpret_cast<int *>(m_data))=*data; *(reinterpret_cast<int *>(m_data))=*data;
return 0; return 0;
} }
else if (IsType(RET_BOOL))
{
*(reinterpret_cast<bool *>(m_data)) = *data > 0;
return 0;
}
else if (IsType(RET_SHORT))
{
*(reinterpret_cast<short *>(m_data)) = *data;
return 0;
}
else if (IsType(RET_ITEMINFO))
{
*(reinterpret_cast<int *>(m_data)) = *data;
return 0;
}
else if (IsType(RET_TRACE)) else if (IsType(RET_TRACE))
{ {
*(reinterpret_cast<int *>(m_data))=*data; *(reinterpret_cast<int *>(m_data))=*data;
@ -201,6 +251,16 @@ public:
return 0; return 0;
} }
else if (IsType(RET_EDICT))
{
*(reinterpret_cast<edict_t **>(m_data)) = IndexToEdict(*data);
if (m_index != 0)
{
*m_index = *data;
}
return 0;
}
return -1; return -1;
}; };
@ -216,6 +276,25 @@ public:
return 0; return 0;
} }
else if (IsType(RET_BOOL))
{
*data = *(reinterpret_cast<bool *>(m_data));
return 0;
}
else if (IsType(RET_SHORT))
{
*data = *(reinterpret_cast<short *>(m_data));
return 0;
}
else if (IsType(RET_ITEMINFO))
{
*data = *(reinterpret_cast<int *>(m_data));
return 0;
}
else if (IsType(RET_TRACE)) else if (IsType(RET_TRACE))
{ {
*data=*(reinterpret_cast<int *>(m_data)); *data=*(reinterpret_cast<int *>(m_data));
@ -293,6 +372,12 @@ public:
return 0; return 0;
} }
else if (IsType(RET_EDICT))
{
*data = EdictToIndex(reinterpret_cast<edict_t *>(m_data));
return 0;
}
return -1; return -1;
} }
}; };

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it

View File

@ -641,9 +641,9 @@ namespace Trampolines
/** /**
* Utility to make a generic trampoline. * Utility to make a generic trampoline.
*/ */
inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, int paramcount, void *extraptr, void *callee) inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, bool retbuf, int paramcount, void *extraptr, void *callee)
{ {
Trampolines::TrampolineMaker tramp; Trampolines::TrampolineMaker tramp;
if (voidcall) if (voidcall)
{ {
@ -684,7 +684,14 @@ inline void *CreateGenericTrampoline(bool thiscall, bool voidcall, int paramcoun
#if defined(_WIN32) #if defined(_WIN32)
tramp.VoidEpilogueAndFree(); tramp.VoidEpilogueAndFree();
#elif defined(__linux__) || defined(__APPLE__) #elif defined(__linux__) || defined(__APPLE__)
tramp.VoidEpilogue(); if (retbuf)
{
tramp.VoidEpilogue(4);
}
else
{
tramp.ThisVoidPrologue();
}
#endif #endif
} }
else else

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -38,6 +38,7 @@
#include "hooklist.h" #include "hooklist.h"
#include "offsets.h" #include "offsets.h"
#include <assert.h> #include <assert.h>
#include "DataHandler.h"
edict_t *NEW_FirstEdict; edict_t *NEW_FirstEdict;
bool NEW_Initialized; bool NEW_Initialized;
@ -66,6 +67,18 @@ void OnAmxxAttach(void)
assert(strcmp(hooklist[Ham_NS_UpdateOnRemove].name, "ns_updateonremove")==0); assert(strcmp(hooklist[Ham_NS_UpdateOnRemove].name, "ns_updateonremove")==0);
assert(strcmp(hooklist[Ham_TS_ShouldCollide].name, "ts_shouldcollide")==0); assert(strcmp(hooklist[Ham_TS_ShouldCollide].name, "ts_shouldcollide")==0);
assert(strcmp(hooklist[Ham_GetDeathActivity].name, "getdeathactivity")==0);
assert(strcmp(hooklist[Ham_StopFollowing].name, "stopfollowing")==0);
assert(strcmp(hooklist[Ham_CS_Player_OnTouchingWeapon].name, "cstrike_player_ontouchingweapon")==0);
assert(strcmp(hooklist[Ham_DOD_Weapon_Special].name, "dod_weapon_special")==0);
assert(strcmp(hooklist[Ham_TFC_RadiusDamage2].name, "tfc_radiusdamage2")==0);
assert(strcmp(hooklist[Ham_ESF_Weapon_HolsterWhenMeleed].name, "esf_weapon_holsterwhenmeleed") == 0);
assert(strcmp(hooklist[Ham_NS_Weapon_GetDeployTime].name, "ns_weapon_getdeploytime")==0);
assert(strcmp(hooklist[Ham_SC_MedicCallSound].name, "sc_mediccallsound")==0);
assert(strcmp(hooklist[Ham_SC_Player_CanTouchPlayer].name, "sc_player_cantouchplayer")==0);
assert(strcmp(hooklist[Ham_SC_Weapon_ChangeWeaponSkin].name, "sc_weapon_changeweaponskin")==0);
assert(strcmp(hooklist[Ham_Item_GetItemInfo].name, "item_getiteminfo") == 0);
MF_AddNatives(pdata_natives_safe); MF_AddNatives(pdata_natives_safe);
if (ReadConfig() > 0) if (ReadConfig() > 0)
{ {
@ -92,6 +105,17 @@ void OnAmxxAttach(void)
} }
} }
extern CStack<ItemInfo *> g_FreeIIs;
void OnAmxxDetach()
{
while (!g_FreeIIs.empty())
{
delete g_FreeIIs.front();
g_FreeIIs.pop();
}
}
void HamCommand(void); void HamCommand(void);
void OnPluginsUnloaded(void) void OnPluginsUnloaded(void)

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -40,14 +40,20 @@ cell Call_Void_Cbase(AMX *amx, cell *params);
cell Call_Int_Float_Int(AMX *amx, cell *params); cell Call_Int_Float_Int(AMX *amx, cell *params);
cell Call_Int_Float_Int_Int(AMX *amx, cell *params);
cell Call_Void_Entvar_Int(AMX *amx, cell *params); cell Call_Void_Entvar_Int(AMX *amx, cell *params);
cell Call_Void_Entvar_Entvar_Int(AMX *amx, cell *params);
cell Call_Int_Cbase(AMX *amx, cell *params); cell Call_Int_Cbase(AMX *amx, cell *params);
cell Call_Void_Int_Int(AMX *amx, cell *params); cell Call_Void_Int_Int(AMX *amx, cell *params);
cell Call_Int_Int_Str_Int(AMX *amx, cell *params); cell Call_Int_Int_Str_Int(AMX *amx, cell *params);
cell Call_Int_Int_Str_Int_Int(AMX *amx, cell *params);
cell Call_Int_Int(AMX *amx, cell *params); cell Call_Int_Int(AMX *amx, cell *params);
cell Call_Int_Entvar(AMX *amx, cell *params); cell Call_Int_Entvar(AMX *amx, cell *params);
@ -58,6 +64,8 @@ cell Call_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, cell *params);
cell Call_Void_Int(AMX *amx, cell *params); cell Call_Void_Int(AMX *amx, cell *params);
cell Call_Vector_Float_Cbase_Int(AMX *amx, cell *params);
cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params); cell Call_Void_Cbase_Cbase_Int_Float(AMX *amx, cell *params);
cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params); cell Call_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, cell *params);
@ -76,7 +84,7 @@ cell Call_Int_pVector(AMX *amx, cell *params);
cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params); cell Call_Void_Entvar_Float_Float(AMX *amx, cell *params);
cell Call_Int_pFloat_pFloat(AMX *amx, cell *params); cell Call_Void_pFloat_pFloat(AMX *amx, cell *params);
cell Call_Void_Entvar_Float(AMX *amx, cell *params); cell Call_Void_Entvar_Float(AMX *amx, cell *params);
@ -88,6 +96,111 @@ cell Call_Float_Void(AMX *amx, cell *params);
cell Call_Void_Float_Int(AMX* amx, cell* params); cell Call_Void_Float_Int(AMX* amx, cell* params);
cell Call_Float_Float_Cbase(AMX* amx, cell* params);
cell Call_Void_Float(AMX* amx, cell* params);
cell Call_Void_Float_Float_Float_Int(AMX* amx, cell* params);
cell Call_Float_Int(AMX* amx, cell* params);
cell Call_Vector_Float(AMX* amx, cell* params);
cell Call_Void_Float_Cbase(AMX *amx, cell *params);
cell Call_Int_Float_Float(AMX *amx, cell *params);
cell Call_Int_Float(AMX *amx, cell *params);
cell Call_Int_Int_Int(AMX *amx, cell *params);
cell Call_Void_Str_Float_Float_Float(AMX *amx, cell *params);
cell Call_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, cell *params);
cell Call_Int_Vector_Vector_Float_Float(AMX *amx, cell *params);
cell Call_Int_Short(AMX *amx, cell *params);
cell Call_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params);
cell Call_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, cell *params);
cell Call_Float_Int_Float(AMX* amx, cell* params);
cell Call_Int_Str(AMX* amx, cell* params);
cell Call_Void_Edict(AMX* amx, cell* params);
cell Call_Void_Int_Str_Bool(AMX* amx, cell* params);
cell Call_Void_Vector_Vector(AMX* amx, cell* params);
cell Call_Void_Str_Bool(AMX* amx, cell* params);
cell Call_Int_Str_Str_Int_Str_Int_Int(AMX* amx, cell* params);
cell Call_Int_Int_Int_Float_Int(AMX* amx, cell* params);
cell Call_Void_Str_Int(AMX* amx, cell* params);
cell Call_Void_Cbase_Int(AMX* amx, cell* params);
cell Call_Void_Str(AMX* amx, cell* params);
cell Call_Void_Vector(AMX* amx, cell* params);
cell Call_Int_Str_Vector_Str(AMX* amx, cell* params);
cell Call_Int_Str_Str(AMX* amx, cell* params);
cell Call_Void_Float_Float(AMX* amx, cell* params);
cell Call_Void_Str_Str_Int(AMX* amx, cell* params);
cell Call_Int_pVector_pVector_Cbase_pFloat(AMX* amx, cell* params);
cell Call_Void_Cbase_pVector_Float(AMX* amx, cell* params);
cell Call_Int_pVector_pVector_Float_Cbase_pVector(AMX* amx, cell* params);
cell Call_Int_Cbase_Bool(AMX* amx, cell* params);
cell Call_Int_Vector_Vector(AMX *amx, cell *params);
cell Call_Int_Entvar_Float(AMX *amx, cell *params);
cell Call_Float_Float(AMX* amx, cell* params);
cell Call_Void_Entvar_Entvar_Float(AMX *amx, cell *params);
cell Call_Bool_Void(AMX *amx, cell *params);
cell Call_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX* amx, cell* params);
cell Call_Int_Vector_Cbase(AMX *amx, cell *params);
cell Call_Int_Vector(AMX *amx, cell *params);
cell Call_Int_Cbase_pVector(AMX *amx, cell *params);
cell Call_Void_Bool(AMX *amx, cell *params);
cell Call_Bool_Cbase(AMX *amx, cell *params);
cell Call_Bool_Int(AMX *amx, cell *params);
cell Call_Void_Cbase_Float(AMX* amx, cell* params);
cell Call_Void_Cbase_Bool(AMX* amx, cell* params);
cell Call_Vector_Vector_Vector_Vector(AMX *amx, cell *params);
cell Call_Str_Str(AMX *amx, cell *params);
cell Call_Void_Short(AMX *amx, cell *params);
cell Call_Deprecated(AMX* amx, cell* params); cell Call_Deprecated(AMX* amx, cell* params);
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -233,7 +233,7 @@ static const char* get_localinfo( const char* name , const char* def = 0 )
} }
int read_start_section(char *data) int read_start_section(char *data)
{ {
if (strncmp(data, CurrentModName, strlen(CurrentModName))==0) if (strncasecmp(data, CurrentModName, strlen(CurrentModName))==0)
{ {
data+=strlen(CurrentModName)+1; data+=strlen(CurrentModName)+1;
trim_line(data); trim_line(data);

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -183,6 +183,323 @@ enum
Ham_TS_OnFreeEntPrivateData, Ham_TS_OnFreeEntPrivateData,
Ham_TS_ShouldCollide, Ham_TS_ShouldCollide,
//
// New addition - 2011
//
Ham_ChangeYaw,
Ham_HasHumanGibs,
Ham_HasAlienGibs,
Ham_FadeMonster,
Ham_GibMonster,
Ham_BecomeDead,
Ham_IRelationship,
Ham_PainSound,
Ham_ReportAIState,
Ham_MonsterInitDead,
Ham_Look,
Ham_BestVisibleEnemy,
Ham_FInViewCone,
Ham_FVecInViewCone,
Ham_GetDeathActivity,
// Not valid in CS, NS and TS.
Ham_RunAI,
Ham_MonsterThink,
Ham_MonsterInit,
Ham_CheckLocalMove,
Ham_Move,
Ham_MoveExecute,
Ham_ShouldAdvanceRoute,
Ham_GetStoppedActivity,
Ham_Stop,
Ham_CheckRangeAttack1,
Ham_CheckRangeAttack2,
Ham_CheckMeleeAttack1,
Ham_CheckMeleeAttack2,
Ham_ScheduleChange,
Ham_CanPlaySequence,
Ham_CanPlaySentence,
Ham_PlaySentence,
Ham_PlayScriptedSentence,
Ham_SentenceStop,
Ham_GetIdealState,
Ham_SetActivity,
Ham_CheckEnemy,
Ham_FTriangulate,
Ham_SetYawSpeed,
Ham_BuildNearestRoute,
Ham_FindCover,
Ham_CoverRadius,
Ham_FCanCheckAttacks,
Ham_CheckAmmo,
Ham_IgnoreConditions,
Ham_FValidateHintType,
Ham_FCanActiveIdle,
Ham_ISoundMask,
Ham_HearingSensitivity,
Ham_BarnacleVictimBitten,
Ham_BarnacleVictimReleased,
Ham_PrescheduleThink,
Ham_DeathSound,
Ham_AlertSound,
Ham_IdleSound,
Ham_StopFollowing,
Ham_CS_Weapon_SendWeaponAnim,
Ham_CS_Player_ResetMaxSpeed,
Ham_CS_Player_IsBot,
Ham_CS_Player_GetAutoaimVector,
Ham_CS_Player_Blind,
Ham_CS_Player_OnTouchingWeapon,
Ham_DOD_SetScriptReset,
Ham_DOD_Item_SpawnDeploy,
Ham_DOD_Item_SetDmgTime,
Ham_DOD_Item_DropGren,
Ham_DOD_Weapon_IsUseable,
Ham_DOD_Weapon_Aim,
Ham_DOD_Weapon_flAim,
Ham_DOD_Weapon_RemoveStamina,
Ham_DOD_Weapon_ChangeFOV,
Ham_DOD_Weapon_ZoomOut,
Ham_DOD_Weapon_ZoomIn,
Ham_DOD_Weapon_GetFOV,
Ham_DOD_Weapon_IsWaterSniping,
Ham_DOD_Weapon_UpdateZoomSpeed,
Ham_DOD_Weapon_Special,
Ham_TFC_DB_GetItemName,
Ham_TFC_RadiusDamage,
Ham_TFC_RadiusDamage2,
Ham_ESF_IsFighter,
Ham_ESF_IsBuddy,
Ham_ESF_EmitSound,
Ham_ESF_EmitNullSound,
Ham_ESF_IncreaseStrength,
Ham_ESF_IncreasePL,
Ham_ESF_SetPowerLevel,
Ham_ESF_SetMaxPowerLevel,
Ham_ESF_StopAniTrigger,
Ham_ESF_StopFly,
Ham_ESF_HideWeapon,
Ham_ESF_ClientRemoveWeapon,
Ham_ESF_SendClientsCustomModel,
Ham_ESF_CanTurbo,
Ham_ESF_CanPrimaryFire,
Ham_ESF_CanSecondaryFire,
Ham_ESF_CanStopFly,
Ham_ESF_CanBlock,
Ham_ESF_CanRaiseKi,
Ham_ESF_CanRaiseStamina,
Ham_ESF_CanTeleport,
Ham_ESF_CanStartFly,
Ham_ESF_CanStartPowerup,
Ham_ESF_CanJump,
Ham_ESF_CanWallJump,
Ham_ESF_IsSuperJump,
Ham_ESF_IsMoveBack,
Ham_ESF_CheckWallJump,
Ham_ESF_EnableWallJump,
Ham_ESF_DisableWallJump,
Ham_ESF_ResetWallJumpVars,
Ham_ESF_GetWallJumpAnim,
Ham_ESF_GetWallJumpAnim2,
Ham_ESF_SetWallJumpAnimation,
Ham_ESF_SetFlyMoveType,
Ham_ESF_IsFlyMoveType,
Ham_ESF_IsWalkMoveType,
Ham_ESF_SetWalkMoveType,
Ham_ESF_DrawChargeBar,
Ham_ESF_StartBlock,
Ham_ESF_StopBlock,
Ham_ESF_StartFly,
Ham_ESF_GetMaxSpeed,
Ham_ESF_SetAnimation,
Ham_ESF_PlayAnimation,
Ham_ESF_GetMoveForward,
Ham_ESF_GetMoveRight,
Ham_ESF_GetMoveUp,
Ham_ESF_AddBlindFX,
Ham_ESF_RemoveBlindFX,
Ham_ESF_DisablePSBar,
Ham_ESF_AddBeamBoxCrosshair,
Ham_ESF_RemoveBeamBoxCrosshair,
Ham_ESF_DrawPSWinBonus,
Ham_ESF_DrawPSBar,
Ham_ESF_LockCrosshair,
Ham_ESF_UnLockCrosshair,
Ham_ESF_RotateCrosshair,
Ham_ESF_UnRotateCrosshair,
Ham_ESF_WaterMove,
Ham_ESF_CheckTimeBasedDamage,
Ham_ESF_DoesSecondaryAttack,
Ham_ESF_DoesPrimaryAttack,
Ham_ESF_RemoveSpecialModes,
Ham_ESF_StopTurbo,
Ham_ESF_TakeBean,
Ham_ESF_GetPowerLevel,
Ham_ESF_RemoveAllOtherWeapons,
Ham_ESF_StopSwoop,
Ham_ESF_SetDeathAnimation,
Ham_ESF_SetModel,
Ham_ESF_AddAttacks,
Ham_ESF_EmitClassSound,
Ham_ESF_CheckLightning,
Ham_ESF_FreezeControls,
Ham_ESF_UnFreezeControls,
Ham_ESF_UpdateKi,
Ham_ESF_UpdateHealth,
Ham_ESF_GetTeleportDir,
Ham_ESF_Weapon_HolsterWhenMeleed,
Ham_NS_SetBoneController,
Ham_NS_SaveDataForReset,
Ham_NS_GetHull,
Ham_NS_GetMaxWalkSpeed,
Ham_NS_SetTeamID,
Ham_NS_GetEffectivePlayerClass,
Ham_NS_GetAuthenticationMask,
Ham_NS_EffectivePlayerClassChanged,
Ham_NS_NeedsTeamUpdate,
Ham_NS_SendTeamUpdate,
Ham_NS_SendWeaponUpdate,
Ham_NS_InitPlayerFromSpawn,
Ham_NS_PackDeadPlayerItems,
Ham_NS_GetAnimationForActivity,
Ham_NS_StartObserver,
Ham_NS_StopObserver,
Ham_NS_GetAdrenalineFactor,
Ham_NS_GetNamedItem,
Ham_NS_Suicide,
Ham_NS_GetCanUseWeapon,
Ham_NS_Weapon_GetWeapPrimeTime,
Ham_NS_Weapon_PrimeWeapon,
Ham_NS_Weapon_GetIsWeaponPrimed,
Ham_NS_Weapon_GetIsWeaponPriming,
Ham_NS_Weapon_DefaultDeploy,
Ham_NS_Weapon_DefaultReload,
Ham_NS_Weapon_GetDeployTime,
Ham_SC_GetClassification,
Ham_SC_IsMonster,
Ham_SC_IsPhysX,
Ham_SC_IsPointEntity,
Ham_SC_IsMachine,
Ham_SC_CriticalRemove,
Ham_SC_UpdateOnRemove,
Ham_SC_FVisible,
Ham_SC_FVisibleFromPos,
Ham_SC_IsFacings,
Ham_SC_GetPointsForDamage,
Ham_SC_GetDamagePoints,
Ham_SC_OnCreate,
Ham_SC_OnDestroy,
Ham_SC_IsValidEntity,
Ham_SC_ShouldFadeOnDeath,
Ham_SC_SetupFriendly,
Ham_SC_ReviveThink,
Ham_SC_Revive,
Ham_SC_StartMonster,
Ham_SC_CheckRangeAttack1_Move,
Ham_SC_CheckRangeAttack2_Move,
Ham_SC_CheckMeleeAttack1_Move,
Ham_SC_CheckMeleeAttack2_Move,
Ham_SC_CheckTankUsage,
Ham_SC_SetGaitActivity,
Ham_SC_FTriangulate,
Ham_SC_FTriangulateExtension,
Ham_SC_FindCoverGrenade,
Ham_SC_FindCoverDistance,
Ham_SC_FindAttackPoint,
Ham_SC_FValidateCover,
Ham_SC_NoFriendlyFire1,
Ham_SC_NoFriendlyFire2,
Ham_SC_NoFriendlyFire3,
Ham_SC_NoFriendlyFireToPos,
Ham_SC_FVisibleGunPos,
Ham_SC_FInBulletCone,
Ham_SC_CallGibMonster,
Ham_SC_CheckTimeBasedDamage,
Ham_SC_IsMoving,
Ham_SC_IsPlayerFollowing,
Ham_SC_StartPlayerFollowing,
Ham_SC_StopPlayerFollowing,
Ham_SC_UseSound,
Ham_SC_UnUseSound,
Ham_SC_RideMonster,
Ham_SC_CheckApplyGenericAttacks,
Ham_SC_CheckScared,
Ham_SC_CheckCreatureDanger,
Ham_SC_CheckFallDamage,
Ham_SC_CheckRevival,
Ham_SC_MedicCallSound,
Ham_SC_Player_MenuInputPerformed,
Ham_SC_Player_IsMenuInputDone,
Ham_SC_Player_SpecialSpawn,
Ham_SC_Player_IsValidInfoEntity,
Ham_SC_Player_LevelEnd,
Ham_SC_Player_VoteStarted,
Ham_SC_Player_CanStartNextVote,
Ham_SC_Player_Vote,
Ham_SC_Player_HasVoted,
Ham_SC_Player_ResetVote,
Ham_SC_Player_LastVoteInput,
Ham_SC_Player_InitVote,
Ham_SC_Player_TimeToStartNextVote,
Ham_SC_Player_ResetView,
Ham_SC_Player_GetLogFrequency,
Ham_SC_Player_LogPlayerStats,
Ham_SC_Player_DisableCollisionWithPlayer,
Ham_SC_Player_EnableCollisionWithPlayer,
Ham_SC_Player_CanTouchPlayer,
Ham_SC_Item_Materialize,
Ham_SC_Weapon_BulletAccuracy,
Ham_SC_Weapon_TertiaryAttack,
Ham_SC_Weapon_BurstSupplement,
Ham_SC_Weapon_GetP_Model,
Ham_SC_Weapon_GetW_Model,
Ham_SC_Weapon_GetV_Model,
Ham_SC_Weapon_PrecacheCustomModels,
Ham_SC_Weapon_IsMultiplayer,
Ham_SC_Weapon_FRunfuncs,
Ham_SC_Weapon_SetFOV,
Ham_SC_Weapon_FCanRun,
Ham_SC_Weapon_CustomDecrement,
Ham_SC_Weapon_SetV_Model,
Ham_SC_Weapon_SetP_Model,
Ham_SC_Weapon_ChangeWeaponSkin,
//
// New addition - 2013
//
Ham_TFC_Killed,
Ham_TFC_IsTriggered,
Ham_TFC_Weapon_SendWeaponAnim,
Ham_TFC_Weapon_GetNextAttackDelay,
Ham_SC_TakeHealth,
Ham_SC_TakeArmor,
Ham_SC_GiveAmmo,
Ham_SC_CheckAttacker,
Ham_SC_Player_IsConnected,
Ham_DOD_Weapon_SendWeaponAnim,
Ham_CS_Item_IsWeapon,
Ham_OPF_MySquadTalkMonsterPointer,
Ham_OPF_WeaponTimeBase,
Ham_TS_Weapon_AlternateAttack,
Ham_Item_GetItemInfo,
HAM_LAST_ENTRY_DONT_USE_ME_LOL HAM_LAST_ENTRY_DONT_USE_ME_LOL
}; };

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -130,6 +130,21 @@ inline int EntvarToIndex(entvars_t *pev)
return ENTINDEX_NEW(pev->pContainingEntity); return ENTINDEX_NEW(pev->pContainingEntity);
}; };
inline int EdictToIndex(edict_t *v)
{
if (v==NULL)
{
return -1;
}
return ENTINDEX_NEW(v);
}
inline edict_t *IndexToEdict(int index)
{
return INDEXENT_NEW(index);
};
inline edict_t *EntvarToEdict(entvars_t *pev) inline edict_t *EntvarToEdict(entvars_t *pev)
{ {
if (pev==NULL) if (pev==NULL)
@ -157,5 +172,5 @@ inline void *GetVTableEntry(void *pthis, int ventry, int size)
return vtbl[ventry]; return vtbl[ventry];
} }
void print_srvconsole(char *fmt, ...); void print_srvconsole(const char *fmt, ...);
#endif #endif

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -32,11 +32,11 @@
#include "forward.h" #include "forward.h"
#include "Trampolines.h" #include "Trampolines.h"
#define ALIGN(ar) ((intptr_t)ar & ~(sysconf(_SC_PAGESIZE)-1))
// This is just a simple container for data so I only have to add 1 extra // This is just a simple container for data so I only have to add 1 extra
// parameter to calls that get trampolined // parameter to calls that get trampolined
#define ALIGN(ar) ((intptr_t)ar & ~(sysconf(_SC_PAGESIZE)-1))
class Hook class Hook
{ {
public: public:
@ -51,7 +51,7 @@ public:
void *tramp; // trampoline for this hook void *tramp; // trampoline for this hook
char *ent; // ent name that's being hooked char *ent; // ent name that's being hooked
Hook(void **vtable_, int entry_, void *target_, bool voidcall, int paramcount, char *name) : Hook(void **vtable_, int entry_, void *target_, bool voidcall, bool retbuf, int paramcount, char *name) :
func(NULL), vtable(vtable_), entry(entry_), target(target_), exec(0), del(0), tramp(NULL) func(NULL), vtable(vtable_), entry(entry_), target(target_), exec(0), del(0), tramp(NULL)
{ {
// original function is vtable[entry] // original function is vtable[entry]
@ -61,7 +61,7 @@ public:
// now install a trampoline // now install a trampoline
// (int thiscall, int voidcall, int paramcount, void *extraptr) // (int thiscall, int voidcall, int paramcount, void *extraptr)
tramp=CreateGenericTrampoline(true, voidcall, paramcount, (void*)this, target); tramp = CreateGenericTrampoline(true, voidcall, retbuf, paramcount, (void*)this, target);
// Insert into vtable // Insert into vtable
#if defined(_WIN32) #if defined(_WIN32)
@ -87,7 +87,7 @@ public:
#if defined(_WIN32) #if defined(_WIN32)
DWORD OldFlags; DWORD OldFlags;
VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags); VirtualProtect(&ivtable[entry],sizeof(int*),PAGE_READWRITE,&OldFlags);
#elif defined(__linux_) || defined(__APPLE__) #elif defined(__linux__) || defined(__APPLE__)
void *addr = (void *)ALIGN(&ivtable[entry]); void *addr = (void *)ALIGN(&ivtable[entry]);
mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE); mprotect(addr,sysconf(_SC_PAGESIZE),PROT_READ|PROT_WRITE);
#endif #endif

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -26,61 +26,88 @@
* you do not wish to do so, delete this exception statement from your * you do not wish to do so, delete this exception statement from your
* version. * version.
*/ */
#ifndef HOOK_CALLBACKS_H #ifndef HOOK_CALLBACKS_H
#define HOOK_CALLBACKS_H #define HOOK_CALLBACKS_H
// RT_<TYPE> is true if the function returns void, false otherwise // RT_<TYPE> is true if the function returns void, false otherwise
// (it also would be true for large return functions such as Vector) // (it also would be true for large return functions such as Vector)
// RB_<TYPE> is true if the function returns an object and requires a pointer to a buffer as its first parameter in order to store its value
// PC_<TYPE> is how many dwords get passed to the function (minus the "this" pointer) // PC_<TYPE> is how many dwords get passed to the function (minus the "this" pointer)
// (it is one larger for large return functions such as Vector) // (it is one larger for large return functions such as Vector)
const bool RT_Void_Void = true; const bool RT_Void_Void = true;
const bool RB_Void_Void = false;
const int PC_Void_Void = 0; const int PC_Void_Void = 0;
void Hook_Void_Void(Hook *hook, void *pthis); void Hook_Void_Void(Hook *hook, void *pthis);
const bool RT_Int_Void = false; const bool RT_Int_Void = false;
const bool RB_Int_Void = false;
const int PC_Int_Void = 0; const int PC_Int_Void = 0;
int Hook_Int_Void(Hook *hook, void *pthis); int Hook_Int_Void(Hook *hook, void *pthis);
const bool RT_Void_Entvar = true; const bool RT_Void_Entvar = true;
const bool RB_Void_Entvar = false;
const int PC_Void_Entvar = 1; const int PC_Void_Entvar = 1;
void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar); void Hook_Void_Entvar(Hook *hook, void *pthis, entvars_t *entvar);
const bool RT_Void_Cbase = true; const bool RT_Void_Cbase = true;
const bool RB_Void_Cbase = false;
const int PC_Void_Cbase = 1; const int PC_Void_Cbase = 1;
void Hook_Void_Cbase(Hook *hook, void *pthis, void *other); void Hook_Void_Cbase(Hook *hook, void *pthis, void *other);
const bool RT_Int_Float_Int = false; const bool RT_Int_Float_Int = false;
const bool RB_Int_Float_Int = false;
const int PC_Int_Float_Int = 2; const int PC_Int_Float_Int = 2;
int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1); int Hook_Int_Float_Int(Hook *hook, void *pthis, float f1, int i1);
const bool RT_Int_Float_Int_Int = false;
const bool RB_Int_Float_Int_Int = false;
const int PC_Int_Float_Int_Int = 3;
int Hook_Int_Float_Int_Int(Hook *hook, void *pthis, float f1, int i1, int i2);
const bool RT_Void_Entvar_Int = true; const bool RT_Void_Entvar_Int = true;
const bool RB_Void_Entvar_Int = false;
const int PC_Void_Entvar_Int = 2; const int PC_Void_Entvar_Int = 2;
void Hook_Void_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, int i1); void Hook_Void_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, int i1);
const bool RT_Void_Entvar_Entvar_Int = true;
const bool RB_Void_Entvar_Entvar_Int = false;
const int PC_Void_Entvar_Entvar_Int = 3;
void Hook_Void_Entvar_Entvar_Int(Hook *hook, void *ptis, entvars_t *ev1, entvars_t *ev2, int i1);
const bool RT_Int_Cbase = false; const bool RT_Int_Cbase = false;
const bool RB_Int_Cbase = false;
const int PC_Int_Cbase = 1; const int PC_Int_Cbase = 1;
int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1); int Hook_Int_Cbase(Hook *hook, void *pthis, void *cb1);
const bool RT_Void_Int_Int = true; const bool RT_Void_Int_Int = true;
const bool RB_Void_Int_Int = false;
const int PC_Void_Int_Int = 2; const int PC_Void_Int_Int = 2;
void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2); void Hook_Void_Int_Int(Hook *hook, void *pthis, int i1, int i2);
const bool RT_Int_Int_Str_Int = false; const bool RT_Int_Int_Str_Int = false;
const bool RB_Int_Int_Str_Int = false;
const int PC_Int_Int_Str_Int = 3; const int PC_Int_Int_Str_Int = 3;
int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1, int Hook_Int_Int_Str_Int(Hook *hook, void *pthis, int i1, const char *sz1,
int i2); int i2);
const bool RT_Int_Int_Str_Int_Int = false;
const bool RB_Int_Int_Str_Int_Int = false;
const int PC_Int_Int_Str_Int_Int = 4;
int Hook_Int_Int_Str_Int_Int(Hook *hook, void *pthis, int i1, const char *sz1, int i2, int i3);
const bool RT_Int_Int = false; const bool RT_Int_Int = false;
const bool RB_Int_Int = false;
const int PC_Int_Int = 1; const int PC_Int_Int = 1;
int Hook_Int_Int(Hook *hook, void *pthis, int i1); int Hook_Int_Int(Hook *hook, void *pthis, int i1);
const bool RT_Int_Entvar = false; const bool RT_Int_Entvar = false;
const bool RB_Int_Entvar = false;
const int PC_Int_Entvar = 1; const int PC_Int_Entvar = 1;
int Hook_Int_Entvar(Hook *hook, void *pthis, entvars_t *ev1); int Hook_Int_Entvar(Hook *hook, void *pthis, entvars_t *ev1);
const bool RT_Int_Entvar_Entvar_Float_Int = false; const bool RT_Int_Entvar_Entvar_Float_Int = false;
const bool RB_Int_Entvar_Entvar_Float_Int = false;
const int PC_Int_Entvar_Entvar_Float_Int = 4; const int PC_Int_Entvar_Entvar_Float_Int = 4;
int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis, int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis,
entvars_t *inflictor, entvars_t *inflictor,
@ -88,6 +115,7 @@ int Hook_Int_Entvar_Entvar_Float_Int(Hook *hook, void *pthis,
int damagebits); int damagebits);
const bool RT_Int_Entvar_Entvar_Float_Float_Int = false; const bool RT_Int_Entvar_Entvar_Float_Float_Int = false;
const bool RB_Int_Entvar_Entvar_Float_Float_Int = false;
const int PC_Int_Entvar_Entvar_Float_Float_Int = 5; const int PC_Int_Entvar_Entvar_Float_Float_Int = 5;
int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis, int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis,
entvars_t *inflictor, entvars_t *inflictor,
@ -95,15 +123,27 @@ int Hook_Int_Entvar_Entvar_Float_Float_Int(Hook *hook, void *pthis,
float unknown, int damagebits); float unknown, int damagebits);
const bool RT_Void_Int = true; const bool RT_Void_Int = true;
const bool RB_Void_Int = false;
const int PC_Void_Int = 1; const int PC_Void_Int = 1;
void Hook_Void_Int(Hook *hook, void *pthis, int i1); void Hook_Void_Int(Hook *hook, void *pthis, int i1);
const bool RT_Void_Cbase_Cbase_Int_Float = true; const bool RT_Void_Cbase_Cbase_Int_Float = true;
const bool RB_Void_Cbase_Cbase_Int_Float = false;
const int PC_Void_Cbase_Cbase_Int_Float = 4; const int PC_Void_Cbase_Cbase_Int_Float = 4;
void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1, void Hook_Void_Cbase_Cbase_Int_Float(Hook *hook, void *pthis, void *cb1,
void *cb2, int i1, float f1); void *cb2, int i1, float f1);
const bool RT_Vector_Float_Cbase_Int = true;
const bool RB_Vector_Float_Cbase_Int = true;
const int PC_Vector_Float_Cbase_Int = 4;
#if defined(_WIN32)
void Hook_Vector_Float_Cbase_Int(Hook *hook, void *pthis, Vector *out, float f1, void *cb, int i1);
#elif defined(__linux__) || defined(__APPLE__)
void Hook_Vector_Float_Cbase_Int(Hook *hook, Vector *out, void *pthis, float f1, void *cb, int i1);
#endif
const bool RT_Void_Entvar_Float_Vector_Trace_Int = true; const bool RT_Void_Entvar_Float_Vector_Trace_Int = true;
const bool RB_Void_Entvar_Float_Vector_Trace_Int = false;
const int PC_Void_Entvar_Float_Vector_Trace_Int = 7; const int PC_Void_Entvar_Float_Vector_Trace_Int = 7;
void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis, void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis,
entvars_t *ev1, float f1, entvars_t *ev1, float f1,
@ -111,77 +151,363 @@ void Hook_Void_Entvar_Float_Vector_Trace_Int(Hook *hook, void *pthis,
int i1); int i1);
const bool RT_Void_Float_Vector_Trace_Int = true; const bool RT_Void_Float_Vector_Trace_Int = true;
const bool RB_Void_Float_Vector_Trace_Int = false;
const int PC_Void_Float_Vector_Trace_Int = 6; const int PC_Void_Float_Vector_Trace_Int = 6;
void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1, void Hook_Void_Float_Vector_Trace_Int(Hook *hook, void *pthis, float f1,
Vector v1, TraceResult *tr1, Vector v1, TraceResult *tr1,
int i1); int i1);
const bool RT_Str_Void = false; const bool RT_Str_Void = false;
const bool RB_Str_Void = false;
const int PC_Str_Void = 0; const int PC_Str_Void = 0;
const char *Hook_Str_Void(Hook *hook, void *pthis); const char *Hook_Str_Void(Hook *hook, void *pthis);
const bool RT_Cbase_Void = false; const bool RT_Cbase_Void = false;
const bool RB_Cbase_Void = false;
const int PC_Cbase_Void = 0; const int PC_Cbase_Void = 0;
void *Hook_Cbase_Void(Hook *hook, void *pthis); void *Hook_Cbase_Void(Hook *hook, void *pthis);
// HACK: I'm too lazy to fix up trampoline generator to deal with // HACK: I'm too lazy to fix up trampoline generator to deal with
// special return values. this is so much easier. // special return values. this is so much easier.
const bool RT_Vector_Void = true; const bool RT_Vector_Void = true;
const bool RB_Vector_Void = true;
const int PC_Vector_Void = 1; const int PC_Vector_Void = 1;
#ifdef _WIN32 #if defined(_WIN32)
void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out); void Hook_Vector_Void(Hook *hook, void *pthis, Vector *out);
#elif defined(__linux__) || defined(__APPLE__) #elif defined(__linux__) || defined(__APPLE__)
void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis); void Hook_Vector_Void(Hook *hook, Vector *out, void *pthis);
#endif #endif
const bool RT_Vector_pVector = true; const bool RT_Vector_pVector = true;
const bool RB_Vector_pVector = true;
const int PC_Vector_pVector = 2; const int PC_Vector_pVector = 2;
#ifdef _WIN32 #if defined(_WIN32)
void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1); void Hook_Vector_pVector(Hook *hook, void *pthis, Vector *out, Vector *v1);
#elif defined(__linux__) || defined(__APPLE__) #elif defined(__linux__) || defined(__APPLE__)
void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1); void Hook_Vector_pVector(Hook *hook, Vector *out, void *pthis, Vector *v1);
#endif #endif
const bool RT_Int_pVector = false; const bool RT_Int_pVector = false;
const bool RB_Int_pVector = false;
const int PC_Int_pVector = 1; const int PC_Int_pVector = 1;
int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1); int Hook_Int_pVector(Hook *hook, void *pthis, Vector *v1);
const bool RT_Void_Entvar_Float_Float = true; const bool RT_Void_Entvar_Float_Float = true;
const bool RB_Void_Entvar_Float_Float = false;
const int PC_Void_Entvar_Float_Float = 3; const int PC_Void_Entvar_Float_Float = 3;
void Hook_Void_Entvar_Float_Float(Hook *hook, void *pthis, entvars_t *ev1, void Hook_Void_Entvar_Float_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1, float f2);
float f1, float f2);
const bool RT_Int_pFloat_pFloat = false; const bool RT_Void_pFloat_pFloat = true;
const int PC_Int_pFloat_pFloat = 2; const bool RB_Void_pFloat_pFloat = false;
int Hook_Int_pFloat_pFloat(Hook *hook, void *pthis, float *f1, const int PC_Void_pFloat_pFloat = 2;
float *f2); void Hook_Void_pFloat_pFloat(Hook *hook, void *pthis, float *f1, float *f2);
const bool RT_Void_Entvar_Float = true; const bool RT_Void_Entvar_Float = true;
const bool RB_Void_Entvar_Float = false;
const int PC_Void_Entvar_Float = 2; const int PC_Void_Entvar_Float = 2;
void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1); void Hook_Void_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1);
const bool RT_Void_Int_Int_Int = true; const bool RT_Void_Int_Int_Int = true;
const bool RB_Void_Int_Int_Int = false;
const int PC_Void_Int_Int_Int = 3; const int PC_Void_Int_Int_Int = 3;
void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3); void Hook_Void_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2, int i3);
const bool RT_Void_ItemInfo = true; const bool RT_Void_ItemInfo = true;
const bool RB_Void_ItemInfo = false;
const int PC_Void_ItemInfo = 1; const int PC_Void_ItemInfo = 1;
void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo); void Hook_Void_ItemInfo(Hook *hook, void *pthis, void *iteminfo);
const bool RT_Float_Void = false; const bool RT_Float_Void = false;
const bool RB_Float_Void = false;
const int PC_Float_Void = 0; const int PC_Float_Void = 0;
float Hook_Float_Void(Hook *hook, void *pthis); float Hook_Float_Void(Hook *hook, void *pthis);
const bool RT_Float_Int = false;
const bool RB_Float_Int = false;
const int PC_Float_Int = 1;
float Hook_Float_Int(Hook *hook, void *pthis, int i1);
const bool RT_Void_Float_Int = true; const bool RT_Void_Float_Int = true;
const bool RB_Void_Float_Int = false;
const int PC_Void_Float_Int = 2; const int PC_Void_Float_Int = 2;
void Hook_Void_Float_Int(Hook *hook, void *pthis, float f1, int i1); void Hook_Void_Float_Int(Hook *hook, void *pthis, float f1, int i1);
const bool RT_Float_Float_Cbase = true;
const bool RB_Float_Float_Cbase = false;
const int PC_Float_Float_Cbase = 2;
float Hook_Float_Float_Cbase(Hook *hook, void *pthis, float f1, void *cb1);
const bool RT_Void_Float = true;
const bool RB_Void_Float = false;
const int PC_Void_Float = 1;
void Hook_Void_Float(Hook *hook, void *pthis, float f1);
const bool RT_Void_Float_Float_Float_Int = true;
const bool RB_Void_Float_Float_Float_Int = false;
const int PC_Void_Float_Float_Float_Int = 4;
void Hook_Void_Float_Float_Float_Int(Hook *hook, void *pthis, float f1, float f2, float f3, int i1);
const bool RT_Vector_Float = true;
const bool RB_Vector_Float = true;
const int PC_Vector_Float = 2;
#if defined(_WIN32)
void Hook_Vector_Float(Hook *hook, void *pthis, Vector *out, float f1);
#elif defined(__linux__) || defined(__APPLE__)
void Hook_Vector_Float(Hook *hook, Vector *out, void *pthis, float f1);
#endif
const bool RT_Void_Float_Cbase = true;
const bool RB_Void_Float_Cbase = false;
const int PC_Void_Float_Cbase = 2;
void Hook_Void_Float_Cbase(Hook *hook, void *pthis, float f1, void *cb);
const bool RT_Int_Float_Float = false;
const bool RB_Int_Float_Float = false;
const int PC_Int_Float_Float = 2;
int Hook_Int_Float_Float(Hook *hook, void *pthis, float f1, float f2);
const bool RT_Int_Float = false;
const bool RB_Int_Float = false;
const int PC_Int_Float = 1;
int Hook_Int_Float(Hook *hook, void *pthis, float f1);
const bool RT_Int_Int_Int = false;
const bool RB_Int_Int_Int = false;
const int PC_Int_Int_Int = 2;
int Hook_Int_Int_Int(Hook *hook, void *pthis, int i1, int i2);
const bool RT_Void_Str_Float_Float_Float = true;
const bool RB_Void_Str_Float_Float_Float = false;
const int PC_Void_Str_Float_Float_Float = 4;
void Hook_Void_Str_Float_Float_Float(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3);
const bool RT_Void_Str_Float_Float_Float_Int_Cbase = true;
const bool RB_Void_Str_Float_Float_Float_Int_Cbase = false;
const int PC_Void_Str_Float_Float_Float_Int_Cbase = 6;
void Hook_Void_Str_Float_Float_Float_Int_Cbase(Hook *hook, void *pthis, const char *sz1, float f1, float f2, float f3, int i1, void *cb);
const bool RT_Int_Vector_Vector_Float_Float= false;
const bool RB_Int_Vector_Vector_Float_Float = false;
const int PC_Int_Vector_Vector_Float_Float = 8;
int Hook_Int_Vector_Vector_Float_Float(Hook *hook, void *pthis, Vector v1, Vector v2, float f1, float f2);
const bool RT_Int_Short = false;
const bool RB_Int_Short = false;
const int PC_Int_Short = 1;
int Hook_Int_Short(Hook *hook, void *pthis, short s1);
const bool RT_Void_Entvar_Entvar_Float_Int_Int = true;
const bool RB_Void_Entvar_Entvar_Float_Int_Int = false;
const int PC_Void_Entvar_Entvar_Float_Int_Int = 5;
void Hook_Void_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis,
entvars_t *inflictor,
entvars_t *attacker, float damage,
int classignore, int damagebits);
const bool RT_Void_Vector_Entvar_Entvar_Float_Int_Int = true;
const bool RB_Void_Vector_Entvar_Entvar_Float_Int_Int = false;
const int PC_Void_Vector_Entvar_Entvar_Float_Int_Int = 8;
void Hook_Void_Vector_Entvar_Entvar_Float_Int_Int(Hook *hook, void *pthis,
Vector source,
entvars_t *inflictor,
entvars_t *attacker, float damage,
int classignore, int damagebits);
const bool RT_Float_Int_Float = false;
const bool RB_Float_Int_Float = false;
const int PC_Float_Int_Float = 2;
float Hook_Float_Int_Float(Hook *hook, void *pthis, int i1, float f2);
const bool RT_Int_Str = false;
const bool RB_Int_Str = false;
const int PC_Int_Str = 1;
int Hook_Int_Str(Hook *hook, void *pthis, const char *sz1);
const bool RT_Void_Edict = true;
const bool RB_Void_Edict = false;
const int PC_Void_Edict = 1;
void Hook_Void_Edict(Hook *hook, void *pthis, edict_t *ed1 );
const bool RT_Void_Int_Str_Bool = true;
const bool RB_Void_Int_Str_Bool = false;
const int PC_Void_Int_Str_Bool = 3;
void Hook_Void_Int_Str_Bool(Hook *hook, void *pthis, int i1, const char *sz2, bool b3);
const bool RT_Void_Vector_Vector= true;
const bool RB_Void_Vector_Vector = false;
const int PC_Void_Vector_Vector = 6;
void Hook_Void_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2);
const bool RT_Void_Str_Bool = true;
const bool RB_Void_Str_Bool = false;
const int PC_Void_Str_Bool = 2;
void Hook_Void_Str_Bool(Hook *hook, void *pthis, const char *sz1, bool b2);
const bool RT_Int_Str_Str_Int_Str_Int_Int = false;
const bool RB_Int_Str_Str_Int_Str_Int_Int = false;
const int PC_Int_Str_Str_Int_Str_Int_Int = 6;
int Hook_Int_Str_Str_Int_Str_Int_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i1, const char *sz3, int i2, int i3);
const bool RT_Int_Int_Int_Float_Int = false;
const bool RB_Int_Int_Int_Float_Int = false;
const int PC_Int_Int_Int_Float_Int = 4;
int Hook_Int_Int_Int_Float_Int(Hook *hook, void *pthis, int i1, int i2, float f1, int i3);
const bool RT_Void_Str_Int = true;
const bool RB_Void_Str_Int = false;
const int PC_Void_Str_Int = 2;
void Hook_Void_Str_Int(Hook *hook, void *pthis, const char *sz1, int i2);
const bool RT_Void_Cbase_Int = true;
const bool RB_Void_Cbase_Int = false;
const int PC_Void_Cbase_Int = 2;
void Hook_Void_Cbase_Int(Hook *hook, void *pthis, void *p1, int i1);
const bool RT_Void_Str = true;
const bool RB_Void_Str = false;
const int PC_Void_Str = 1;
void Hook_Void_Str(Hook *hook, void *pthis, const char *sz1);
const bool RT_Void_Vector = true;
const bool RB_Void_Vector = false;
const int PC_Void_Vector = 3;
void Hook_Void_Vector(Hook *hook, void *pthis, Vector v1);
const bool RT_Int_Str_Vector_Str = false;
const bool RB_Int_Str_Vector_Str = false;
const int PC_Int_Str_Vector_Str = 5;
int Hook_Int_Str_Vector_Str(Hook *hook, void *pthis, const char *sz1, Vector v2, const char *sz2);
const bool RT_Int_Str_Str = false;
const bool RB_Int_Str_Str = false;
const int PC_Int_Str_Str = 2;
int Hook_Int_Str_Str(Hook *hook, void *pthis, const char *sz1, const char *sz2);
const bool RT_Void_Float_Float = true;
const bool RB_Void_Float_Float = false;
const int PC_Void_Float_Float = 2;
void Hook_Void_Float_Float(Hook *hook, void *pthis, float f1, float f2);
const bool RT_Void_Str_Str_Int = true;
const bool RB_Void_Str_Str_Int = false;
const int PC_Void_Str_Str_Int = 3;
void Hook_Void_Str_Str_Int(Hook *hook, void *pthis, const char *sz1, const char *sz2, int i3);
const bool RT_Int_pVector_pVector_Cbase_pFloat = false;
const bool RB_Int_pVector_pVector_Cbase_pFloat = false;
const int PC_Int_pVector_pVector_Cbase_pFloat = 4;
int Hook_Int_pVector_pVector_Cbase_pFloat(Hook *hook, void *pthis, Vector *v1, Vector *v2, void* cb, float* fl);
const bool RT_Void_Cbase_pVector_Float = true;
const bool RB_Void_Cbase_pVector_Float = false;
const int PC_Void_Cbase_pVector_Float = 3;
void Hook_Void_Cbase_pVector_Float(Hook *hook, void *pthis, void *p1, Vector *v1, float fl);
const bool RT_Int_pVector_pVector_Float_Cbase_pVector = false;
const bool RB_Int_pVector_pVector_Float_Cbase_pVector = false;
const int PC_Int_pVector_pVector_Float_Cbase_pVector = 5;
int Hook_Int_pVector_pVector_Float_Cbase_pVector(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3);
const bool RT_Int_Cbase_Bool = false;
const bool RB_Int_Cbase_Bool = false;
const int PC_Int_Cbase_Bool = 2;
int Hook_Int_Cbase_Bool(Hook *hook, void *pthis, void *cb1, bool b1);
const bool RT_Int_Vector_Vector = false;
const bool RB_Int_Vector_Vector = false;
const int PC_Int_Vector_Vector = 6;
int Hook_Int_Vector_Vector(Hook *hook, void *pthis, Vector v1, Vector v2);
const bool RT_Int_Entvar_Float = false;
const bool RB_Int_Entvar_Float = false;
const int PC_Int_Entvar_Float = 2;
int Hook_Int_Entvar_Float(Hook *hook, void *pthis, entvars_t *ev1, float f1);
const bool RT_Float_Float = false;
const bool RB_Float_Float = false;
const int PC_Float_Float = 1;
float Hook_Float_Float(Hook *hook, void *pthis, float f1);
const bool RT_Void_Entvar_Entvar_Float = true;
const bool RB_Void_Entvar_Entvar_Float = false;
const int PC_Void_Entvar_Entvar_Float = 3;
void Hook_Void_Entvar_Entvar_Float(Hook *hook, void *pthis, entvars_t *attacker, entvars_t *inflictor, float damage);
const bool RT_Bool_Void = false;
const bool RB_Bool_Void = false;
const int PC_Bool_Void = 0;
bool Hook_Bool_Void(Hook *hook, void *pthis);
const bool RT_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = false;
const bool RB_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = false;
const int PC_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool = 7;
int Hook_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(Hook *hook, void *pthis, Vector *v1, Vector *v2, float fl, void* cb, Vector *v3, Vector *v4, bool b1);
const bool RT_Int_Vector_Cbase = false;
const bool RB_Int_Vector_Cbase = false;
const int PC_Int_Vector_Cbase = 4;
int Hook_Int_Vector_Cbase(Hook *hook, void *pthis, Vector v1, void *cb);
const bool RT_Int_Vector= false;
const bool RB_Int_Vector = false;
const int PC_Int_Vector = 3;
int Hook_Int_Vector(Hook *hook, void *pthis, Vector v1);
const bool RT_Int_Cbase_pVector = false;
const bool RB_Int_Cbase_pVector = false;
const int PC_Int_Cbase_pVector = 2;
int Hook_Int_Cbase_pVector(Hook *hook, void *pthis, void *cb1, Vector *v1);
const bool RT_Void_Bool = true;
const bool RB_Void_Bool = false;
const int PC_Void_Bool = 1;
void Hook_Void_Bool(Hook *hook, void *pthis, bool b1);
const bool RT_Bool_Cbase = false;
const bool RB_Bool_Cbase = false;
const int PC_Bool_Cbase = 1;
bool Hook_Bool_Cbase(Hook *hook, void *pthis, void *cb);
const bool RT_Bool_Int = false;
const bool RB_Bool_Int = false;
const int PC_Bool_Int = 1;
bool Hook_Bool_Int(Hook *hook, void *pthis, int i1);
const bool RT_Void_Cbase_Float = true;
const bool RB_Void_Cbase_Float = false;
const int PC_Void_Cbase_Float = 2;
void Hook_Void_Cbase_Float(Hook *hook, void *pthis, void *p1, float f1);
const bool RT_Void_Cbase_Bool = true;
const bool RB_Void_Cbase_Bool = false;
const int PC_Void_Cbase_Bool = 2;
void Hook_Void_Cbase_Bool(Hook *hook, void *pthis, void *p1, bool b1);
const bool RT_Vector_Vector_Vector_Vector = true;
const bool RB_Vector_Vector_Vector_Vector = true;
const int PC_Vector_Vector_Vector_Vector = 10;
#if defined(_WIN32)
void Hook_Vector_Vector_Vector_Vector(Hook *hook, void *pthis, Vector *out, Vector v1, Vector v2, Vector v3);
#elif defined(__linux__) || defined(__APPLE__)
void Hook_Vector_Vector_Vector_Vector(Hook *hook, Vector *out, void *pthis, Vector v1, Vector v2, Vector v3);
#endif
const bool RT_Str_Str = false;
const bool RB_Str_Str = false;
const int PC_Str_Str = 1;
const char *Hook_Str_Str(Hook *hook, void *pthis, const char* str);
const bool RT_Void_Short = true;
const bool RB_Void_Short = false;
const int PC_Void_Short = 1;
void Hook_Void_Short(Hook *hook, void *pthis, short i1);
const bool RT_Deprecated = true; const bool RT_Deprecated = true;
const bool RB_Deprecated = false;
const int PC_Deprecated = 0; const int PC_Deprecated = 0;
void Hook_Deprecated(Hook* hook); void Hook_Deprecated(Hook* hook);
#endif #endif

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -43,7 +43,6 @@ int Create_Void_Entvar(AMX *amx, const char *func)
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
} }
int Create_Void_Cbase(AMX *amx, const char *func) int Create_Void_Cbase(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
@ -54,12 +53,20 @@ int Create_Int_Float_Int(AMX *amx, const char *func)
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE);
} }
int Create_Int_Float_Int_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Entvar_Int(AMX *amx, const char *func) int Create_Void_Entvar_Int(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
} }
int Create_Void_Entvar_Entvar_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Int_Cbase(AMX *amx, const char *func) int Create_Int_Cbase(AMX *amx, const char *func)
{ {
@ -76,6 +83,11 @@ int Create_Int_Int_Str_Int(AMX *amx, const char *func)
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE);
} }
int Create_Int_Int_Str_Int_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Int_Int(AMX *amx, const char *func) int Create_Int_Int(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
@ -93,7 +105,7 @@ int Create_Int_Entvar_Entvar_Float_Int(AMX *amx, const char *func)
int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func) int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE);
} }
int Create_Void_Int(AMX *amx, const char *func) int Create_Void_Int(AMX *amx, const char *func)
@ -106,6 +118,11 @@ int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func)
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
} }
int Create_Vector_Float_Cbase_Int(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func) int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE);
@ -146,31 +163,298 @@ int Create_Void_Entvar_Float_Float(AMX *amx, const char *func)
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE);
} }
int Create_Int_pFloat_pFloat(AMX *amx, const char *func) int Create_Void_pFloat_pFloat(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE);
} }
int Create_Void_Entvar_Float(AMX *amx, const char *func) int Create_Void_Entvar_Float(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
} }
int Create_Void_Int_Int_Int(AMX *amx, const char *func) int Create_Void_Int_Int_Int(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
} }
int Create_Void_ItemInfo(AMX *amx, const char *func) int Create_Void_ItemInfo(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
} }
int Create_Float_Void(AMX *amx, const char *func) int Create_Float_Void(AMX *amx, const char *func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE);
} }
int Create_Float_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Float_Int(AMX* amx, const char* func) int Create_Void_Float_Int(AMX* amx, const char* func)
{ {
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE); return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE);
} }
int Create_Float_Float_Cbase(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE);
}
int Create_Void_Float(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Void_Float_Float_Float_Int(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE);
}
int Create_Vector_Float(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Void_Float_Cbase(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE);
}
int Create_Int_Float_Float(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE);
}
int Create_Int_Float(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Int_Int_Int(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Str_Float_Float_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_DONE);
}
int Create_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Int_Vector_Vector_Float_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_FLOAT, FP_DONE);
}
int Create_Int_Short(AMX* amx, const char* func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Float_Int_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Int_Str(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE);
}
int Create_Void_Edict(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Int_Str_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_STRING, FP_CELL, FP_DONE);
}
int Create_Void_Vector_Vector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE);
}
int Create_Void_Str_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_CELL, FP_DONE);
}
int Create_Int_Str_Str_Int_Str_Int_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_CELL, FP_STRING, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Int_Int_Int_Float_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_CELL, FP_DONE);
}
int Create_Void_Str_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_CELL, FP_DONE);
}
int Create_Void_Cbase_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Str(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE);
}
int Create_Void_Vector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE);
}
int Create_Int_Str_Vector_Str(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_ARRAY, FP_STRING, FP_DONE);
}
int Create_Int_Str_Str(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_DONE);
}
int Create_Void_Float_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_FLOAT, FP_DONE);
}
int Create_Void_Str_Str_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_STRING, FP_CELL, FP_DONE);
}
int Create_Int_pVector_pVector_Cbase_pFloat(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Void_Cbase_pVector_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_ARRAY, FP_FLOAT, FP_DONE);
}
int Create_Int_pVector_pVector_Float_Cbase_pVector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_CELL, FP_ARRAY, FP_DONE);
}
int Create_Int_Cbase_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Int_Vector_Vector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_DONE);
}
int Create_Int_Entvar_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Float_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Void_Entvar_Entvar_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Bool_Void(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_DONE);
}
int Create_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_FLOAT, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_DONE);
}
int Create_Int_Vector_Cbase(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_CELL, FP_DONE);
}
int Create_Int_Vector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_DONE);
}
int Create_Int_Cbase_pVector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_ARRAY, FP_DONE);
}
int Create_Void_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Bool_Cbase(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Bool_Int(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Void_Cbase_Float(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_FLOAT, FP_DONE);
}
int Create_Void_Cbase_Bool(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Vector_Vector_Vector_Vector(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_ARRAY, FP_ARRAY, FP_ARRAY, FP_DONE);
}
int Create_Str_Str(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_STRING, FP_DONE);
}
int Create_Void_Short(AMX *amx, const char *func)
{
return MF_RegisterSPForwardByName(amx, func, FP_CELL, FP_CELL, FP_DONE);
}
int Create_Deprecated(AMX* amx, const char* func) int Create_Deprecated(AMX* amx, const char* func)
{ {
return -1; return -1;

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -40,14 +40,20 @@ int Create_Void_Cbase(AMX *amx, const char *func);
int Create_Int_Float_Int(AMX *amx, const char *func); int Create_Int_Float_Int(AMX *amx, const char *func);
int Create_Int_Float_Int_Int(AMX *amx, const char *func);
int Create_Void_Entvar_Int(AMX *amx, const char *func); int Create_Void_Entvar_Int(AMX *amx, const char *func);
int Create_Void_Entvar_Entvar_Int(AMX *amx, const char *func);
int Create_Int_Cbase(AMX *amx, const char *func); int Create_Int_Cbase(AMX *amx, const char *func);
int Create_Void_Int_Int(AMX *amx, const char *func); int Create_Void_Int_Int(AMX *amx, const char *func);
int Create_Int_Int_Str_Int(AMX *amx, const char *func); int Create_Int_Int_Str_Int(AMX *amx, const char *func);
int Create_Int_Int_Str_Int_Int(AMX *amx, const char *func);
int Create_Int_Int(AMX *amx, const char *func); int Create_Int_Int(AMX *amx, const char *func);
int Create_Int_Entvar(AMX *amx, const char *func); int Create_Int_Entvar(AMX *amx, const char *func);
@ -58,6 +64,8 @@ int Create_Int_Entvar_Entvar_Float_Float_Int(AMX *amx, const char *func);
int Create_Void_Int(AMX *amx, const char *func); int Create_Void_Int(AMX *amx, const char *func);
int Create_Vector_Float_Cbase_Int(AMX *amx, const char *func);
int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func); int Create_Void_Cbase_Cbase_Int_Float(AMX *amx, const char *func);
int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func); int Create_Void_Entvar_Float_Vector_Trace_Int(AMX *amx, const char *func);
@ -76,7 +84,7 @@ int Create_Int_pVector(AMX *amx, const char *func);
int Create_Void_Entvar_Float_Float(AMX *amx, const char *func); int Create_Void_Entvar_Float_Float(AMX *amx, const char *func);
int Create_Int_pFloat_pFloat(AMX *amx, const char *func); int Create_Void_pFloat_pFloat(AMX *amx, const char *func);
int Create_Void_Entvar_Float(AMX *amx, const char *func); int Create_Void_Entvar_Float(AMX *amx, const char *func);
@ -86,8 +94,112 @@ int Create_Void_ItemInfo(AMX *amx, const char *func);
int Create_Float_Void(AMX *amx, const char *func); int Create_Float_Void(AMX *amx, const char *func);
int Create_Float_Int(AMX *amx, const char *func);
int Create_Void_Float_Int(AMX *amx, const char *func); int Create_Void_Float_Int(AMX *amx, const char *func);
int Create_Float_Float_Cbase(AMX *amx, const char *func);
int Create_Void_Float(AMX *amx, const char *func);
int Create_Void_Float_Float_Float_Int(AMX *amx, const char *func);
int Create_Vector_Float(AMX *amx, const char *func);
int Create_Void_Float_Cbase(AMX *amx, const char *func);
int Create_Int_Float_Float(AMX* amx, const char* func);
int Create_Int_Float(AMX* amx, const char* func);
int Create_Int_Int_Int(AMX* amx, const char* func);
int Create_Void_Str_Float_Float_Float(AMX* amx, const char* func);
int Create_Void_Str_Float_Float_Float_Int_Cbase(AMX *amx, const char *func);
int Create_Int_Vector_Vector_Float_Float(AMX *amx, const char *func);
int Create_Int_Short(AMX* amx, const char* func);
int Create_Void_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func);
int Create_Void_Vector_Entvar_Entvar_Float_Int_Int(AMX *amx, const char *func);
int Create_Float_Int_Float(AMX *amx, const char *func);
int Create_Int_Str(AMX *amx, const char *func);
int Create_Void_Edict(AMX *amx, const char *func);
int Create_Void_Int_Str_Bool(AMX *amx, const char *func);
int Create_Void_Vector_Vector(AMX *amx, const char *func);
int Create_Void_Str_Bool(AMX *amx, const char *func);
int Create_Int_Str_Str_Int_Str_Int_Int(AMX *amx, const char *func);
int Create_Int_Int_Int_Float_Int(AMX *amx, const char *func);
int Create_Void_Str_Int(AMX *amx, const char *func);
int Create_Void_Cbase_Int(AMX *amx, const char *func);
int Create_Void_Str(AMX *amx, const char *func);
int Create_Void_Vector(AMX *amx, const char *func);
int Create_Int_Str_Vector_Str(AMX *amx, const char *func);
int Create_Int_Str_Str(AMX *amx, const char *func);
int Create_Void_Float_Float(AMX *amx, const char *func);
int Create_Void_Str_Str_Int(AMX *amx, const char *func);
int Create_Int_pVector_pVector_Cbase_pFloat(AMX *amx, const char *func);
int Create_Void_Cbase_pVector_Float(AMX *amx, const char *func);
int Create_Int_pVector_pVector_Float_Cbase_pVector(AMX *amx, const char *func);
int Create_Int_Cbase_Bool(AMX *amx, const char *func);
int Create_Int_Vector_Vector(AMX *amx, const char *func);
int Create_Int_Entvar_Float(AMX *amx, const char *func);
int Create_Float_Float(AMX *amx, const char *func);
int Create_Void_Entvar_Entvar_Float(AMX *amx, const char *func);
int Create_Bool_Void(AMX *amx, const char *func);
int Create_Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool(AMX *amx, const char *func);
int Create_Int_Vector_Cbase(AMX *amx, const char *func);
int Create_Int_Vector(AMX *amx, const char *func);
int Create_Int_Cbase_pVector(AMX *amx, const char *func);
int Create_Void_Bool(AMX *amx, const char *func);
int Create_Bool_Cbase(AMX *amx, const char *func);
int Create_Bool_Int(AMX *amx, const char *func);
int Create_Void_Cbase_Float(AMX *amx, const char *func);
int Create_Void_Cbase_Bool(AMX *amx, const char *func);
int Create_Vector_Vector_Vector_Vector(AMX *amx, const char *func);
int Create_Str_Str(AMX *amx, const char *func);
int Create_Void_Short(AMX *amx, const char *func);
int Create_Deprecated(AMX* amx, const char* func); int Create_Deprecated(AMX* amx, const char* func);

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -53,7 +53,7 @@ bool gDoForwards=true;
CVector<Hook *> hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; CVector<Hook *> hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL];
#define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, PC_##__STUFF__, reinterpret_cast<void *>(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__ #define V(__KEYNAME, __STUFF__) 0, 0, __KEYNAME, RT_##__STUFF__, RB_##__STUFF__, PC_##__STUFF__, reinterpret_cast<void *>(Hook_##__STUFF__), Create_##__STUFF__, Call_##__STUFF__
hook_t hooklist[] = hook_t hooklist[] =
{ {
@ -159,6 +159,7 @@ hook_t hooklist[] =
{ V("weapon_retireweapon", Void_Void) }, { V("weapon_retireweapon", Void_Void) },
{ V("weapon_shouldweaponidle", Int_Void) }, { V("weapon_shouldweaponidle", Int_Void) },
{ V("weapon_usedecrement", Int_Void) }, { V("weapon_usedecrement", Int_Void) },
/** Mod specific hooks **/ /** Mod specific hooks **/
/* The Specialists */ /* The Specialists */
@ -182,12 +183,11 @@ hook_t hooklist[] =
{ V("dod_getstateent", Int_Cbase) }, { V("dod_getstateent", Int_Cbase) },
{ V("dod_item_candrop", Int_Void) }, { V("dod_item_candrop", Int_Void) },
/* Team Fortress Classic */ /* Team Fortress Classic */
{ V("tfc_engineeruse", Int_Cbase) }, { V("tfc_engineeruse", Int_Cbase) },
{ V("tfc_finished", Void_Void) }, { V("tfc_finished", Void_Void) },
{ V("tfc_empexplode", Void_Entvar_Float_Float) }, { V("tfc_empexplode", Void_Entvar_Float_Float) },
{ V("tfc_calcempdmgrad", Int_pFloat_pFloat) }, { V("tfc_calcempdmgrad", Void_pFloat_pFloat) },
{ V("tfc_takeempblast", Void_Entvar) }, { V("tfc_takeempblast", Void_Entvar) },
{ V("tfc_empremove", Void_Void) }, { V("tfc_empremove", Void_Void) },
{ V("tfc_takeconcussionblast", Void_Entvar_Float) }, { V("tfc_takeconcussionblast", Void_Entvar_Float) },
@ -211,6 +211,326 @@ hook_t hooklist[] =
{ V("ts_onfreeentprivatedata", Void_Void) }, { V("ts_onfreeentprivatedata", Void_Void) },
{ V("ts_shouldcollide", Int_Cbase) }, { V("ts_shouldcollide", Int_Cbase) },
/** New Additions (2011) **/
{ V("changeyaw", Float_Int) },
{ V("hashumangibs", Int_Void) },
{ V("hasaliengibs", Int_Void) },
{ V("fademonster", Void_Void) },
{ V("gibmonster", Void_Void) },
{ V("becomedead", Void_Void) },
{ V("irelationship", Int_Cbase) },
{ V("painsound", Void_Void) },
{ V("reportaistate", Void_Void) },
{ V("monsterinitdead", Void_Void) },
{ V("look", Void_Int) },
{ V("bestvisibleenemy", Cbase_Void) },
{ V("finviewcone", Int_Cbase) },
{ V("fvecinviewcone", Int_pVector) },
{ V("getdeathactivity", Int_Void) },
/* Not supported by Counter-Strike, The Specialists and Natural Selection mods. */
{ V("runai", Void_Void) },
{ V("monsterthink", Void_Void) },
{ V("monsterinit", Void_Void) },
{ V("checklocalmove", Int_pVector_pVector_Cbase_pFloat) },
{ V("move", Void_Float) },
{ V("moveexecute", Void_Cbase_pVector_Float) },
{ V("shouldadvanceroute", Int_Float) },
{ V("getstoppedactivity", Int_Void) },
{ V("stop", Void_Void) },
{ V("checkrangeattack1", Int_Float_Float) },
{ V("checkrangeattack2", Int_Float_Float) },
{ V("checkmeleeattack1", Int_Float_Float) },
{ V("checkmeleeattack2", Int_Float_Float) },
{ V("schedulechange", Void_Void) },
{ V("canplaysequence", Int_Int_Int) },
{ V("canplaysentence", Int_Int) },
{ V("playsentence", Void_Str_Float_Float_Float) },
{ V("playscriptedsentence", Void_Str_Float_Float_Float_Int_Cbase) },
{ V("sentencestop", Void_Void) },
{ V("getidealstate", Int_Void) },
{ V("setactivity", Void_Int) },
{ V("checkenemy", Int_Cbase) },
{ V("ftriangulate", Int_pVector_pVector_Float_Cbase_pVector) },
{ V("setyawspeed", Void_Void) },
{ V("buildnearestroute", Int_Vector_Vector_Float_Float) },
{ V("findcover", Int_Vector_Vector_Float_Float) },
{ V("coverradius", Float_Void) },
{ V("fcancheckattacks", Int_Void) },
{ V("checkammo", Void_Void) },
{ V("ignoreconditions", Int_Void) },
{ V("fvalidatehinttype", Int_Short) },
{ V("fcanactiveidle", Int_Void) },
{ V("isoundmask", Int_Void) },
{ V("hearingsensitivity", Float_Void) },
{ V("barnaclevictimbitten", Void_Entvar) },
{ V("barnaclevictimreleased", Void_Void) },
{ V("preschedulethink", Void_Void) },
{ V("deathsound", Void_Void) },
{ V("alertsound", Void_Void) },
{ V("idlesound", Void_Void) },
{ V("stopfollowing", Void_Int) },
/** Mod specific hooks **/
/* Counter-Strike */
{ V("cstrike_weapon_sendweaponanim",Void_Int_Int) },
{ V("cstrike_player_resetmaxspeed", Void_Void) },
{ V("cstrike_player_isbot", Int_Void) },
{ V("cstrike_player_getautoaimvector", Vector_Float) },
{ V("cstrike_player_blind", Void_Float_Float_Float_Int) },
{ V("cstrike_player_ontouchingweapon",Void_Cbase) },
/* Day of Defeat */
{ V("dod_setscriptreset", Void_Void) },
{ V("dod_item_spawndeploy", Int_Void) },
{ V("dod_item_setdmgtime", Void_Float) },
{ V("dod_item_dropgren", Void_Void) },
{ V("dod_weapon_isuseable", Int_Void) },
{ V("dod_weapon_aim", Vector_Float_Cbase_Int) },
{ V("dod_weapon_flaim", Float_Float_Cbase) },
{ V("dod_weapon_removestamina", Void_Float_Cbase) },
{ V("dod_weapon_changefov", Int_Int) },
{ V("dod_weapon_zoomout", Int_Void) },
{ V("dod_weapon_zoomin", Int_Void) },
{ V("dod_weapon_getfov", Int_Void) },
{ V("dod_weapon_playeriswatersniping", Bool_Void) },
{ V("dod_weapon_updatezoomspeed", Void_Void) },
{ V("dod_weapon_special", Void_Void) },
/* Team Fortress Classic */
{ V("tfc_dbgetitemname", Str_Void) },
{ V("tfc_radiusdamage", Void_Entvar_Entvar_Float_Int_Int) },
{ V("tfc_radiusdamage2", Void_Vector_Entvar_Entvar_Float_Int_Int) },
/* Earth's Special Forces */
{ V("esf_isfighter", Int_Void) },
{ V("esf_isbuddy", Int_Void) },
{ V("esf_emitsound", Void_Str_Int) },
{ V("esf_emitnullsound", Void_Int) },
{ V("esf_increasestrength", Void_Cbase_Int) },
{ V("esf_increasepl", Void_Int) },
{ V("esf_setpowerlevel", Void_Int) },
{ V("esf_setmaxpowerlevel", Void_Int) },
{ V("esf_stopanitrigger", Void_Int) },
{ V("esf_stopfly", Void_Void) },
{ V("esf_hideweapon", Void_Void) },
{ V("esf_clientremoveweapon", Void_Int) },
{ V("esf_sendclientcustommodel",Void_Str) },
{ V("esf_canturbo", Int_Void) },
{ V("esf_canprimaryfire", Int_Void) },
{ V("esf_cansecondaryfire", Int_Void) },
{ V("esf_canstopfly", Int_Void) },
{ V("esf_canblock", Int_Void) },
{ V("esf_canraiseKi", Int_Void) },
{ V("esf_canraisestamina", Int_Void) },
{ V("esf_canteleport", Int_Void) },
{ V("esf_canstartfly", Int_Void) },
{ V("esf_canstartpowerup", Int_Void) },
{ V("esf_canjump", Int_Void) },
{ V("esf_canwalljump", Int_Void) },
{ V("esf_issuperjump", Int_Void) },
{ V("esf_ismoveback", Int_Void) },
{ V("esf_checkwalljump", Int_Void) },
{ V("esf_enablewalljump", Void_Vector) },
{ V("esf_disablewalljump", Void_Void) },
{ V("esf_resetwalljumpvars", Void_Void) },
{ V("esf_getwalljumpanim", Int_Str_Vector_Str) },
{ V("esf_getwalljumpanim2", Int_Str_Str) },
{ V("esf_setwalljumpanimation", Void_Void) },
{ V("esf_setflymovetype", Void_Void) },
{ V("esf_isflymovetype", Int_Void) },
{ V("esf_iswalkmovetype", Int_Void) },
{ V("esf_setwalkmovetype", Void_Void) },
{ V("esf_drawchargebar", Void_Int) },
{ V("esf_startblock", Void_Void) },
{ V("esf_stopblock", Void_Void) },
{ V("esf_startfly", Void_Void) },
{ V("esf_getmaxspeed", Float_Void) },
{ V("esf_setanimation", Void_Int) },
{ V("esf_playanimation", Void_Void) },
{ V("esf_getmoveforward", Int_Void) },
{ V("esf_getmoveright", Int_Void) },
{ V("esf_getmoveup", Void_Void) },
{ V("esf_addblindfx", Void_Void) },
{ V("esf_removeblindfx", Void_Void) },
{ V("esf_disablepsbar", Void_Void) },
{ V("esf_addbeamboxcrosshair", Void_Int) },
{ V("esf_removebeamboxcrosshair", Void_Void) },
{ V("esf_drawpswinbonus", Void_Void) },
{ V("esf_drawpsbar", Void_Float_Float) },
{ V("esf_lockcrosshair", Void_Void) },
{ V("esf_unlockcrosshair", Void_Void) },
{ V("esf_rotatecrosshair", Void_Void) },
{ V("esf_unrotatecrosshair", Void_Void) },
{ V("esf_watermove", Void_Void) },
{ V("esf_checktimebaseddamage", Void_Void) },
{ V("esf_doessecondaryattack", Int_Void) },
{ V("esf_doesprimaryattack", Int_Void) },
{ V("esf_removespecialmodes", Void_Void) },
{ V("esf_stopturbo", Void_Void) },
{ V("esf_takebean", Void_Void) },
{ V("esf_getpowerlevel", Void_Void) },
{ V("esf_removeallotherweapons",Void_Void) },
{ V("esf_stopswoop", Void_Void) },
{ V("esf_setdeathanimation", Void_Void) },
{ V("esf_setmodel", Void_Void) },
{ V("esf_addattacks", Void_Void) },
{ V("esf_emitclasssound", Void_Str_Str_Int) },
{ V("esf_checklightning", Void_Void) },
{ V("esf_freezecontrols", Void_Void) },
{ V("esf_unfreezecontrols", Void_Void) },
{ V("esf_updateki", Void_Void) },
{ V("esf_updatehealth", Void_Void) },
{ V("esf_getteleportdir", Vector_Void) },
{ V("esf_weapon_holsterwhenmeleed", Void_Void) },
/* Natural-Selection */
{ V("ns_setbonecontroller", Float_Int_Float) },
{ V("ns_savedataforreset", Void_Void) },
{ V("ns_gethull", Int_Void) },
{ V("ns_getmaxwalkspeed", Float_Void) },
{ V("ns_setteamid", Str_Str) },
{ V("ns_geteffectiveplayerclass", Int_Void) },
{ V("ns_getauthenticationmask", Int_Void) },
{ V("ns_effectiveplayerclasschanged", Void_Void) },
{ V("ns_needsteamupdate", Void_Void) },
{ V("ns_sendteamupdate", Void_Void) },
{ V("ns_sendweaponupdate", Void_Void) },
{ V("ns_initplayerfromspawn", Void_Edict) },
{ V("ns_packdeadplayeritems", Void_Void) },
{ V("ns_getanimationforactivity",Void_Int_Str_Bool) },
{ V("ns_startobserver", Void_Vector_Vector) },
{ V("ns_stopobserver", Void_Void) },
{ V("ns_getadrenalinefactor", Float_Void) },
{ V("ns_givenameditem", Void_Str_Bool) },
{ V("ns_suicide", Void_Void) },
{ V("ns_getcanuseweapon", Int_Void) },
{ V("ns_weapon_getweaponprimetime", Float_Void) },
{ V("ns_weapon_primeweapon", Void_Void) },
{ V("ns_weapon_getisweaponprimed", Int_Void) },
{ V("ns_weapon_getisweaponpriming", Int_Void) },
{ V("ns_weapon_defaultdeploy", Int_Str_Str_Int_Str_Int_Int) },
{ V("ns_weapon_defaultreload", Int_Int_Int_Float_Int) },
{ V("ns_weapon_getdeploytime", Float_Void) },
/* Sven co-op */
{ V("sc_getclassification", Int_Int) },
{ V("sc_ismonster", Int_Void) },
{ V("sc_isphysx", Int_Void) },
{ V("sc_ispointentity", Int_Void) },
{ V("sc_ismachine", Int_Void) },
{ V("sc_criticalremove", Int_Void) },
{ V("sc_updateonremove", Void_Void) },
{ V("sc_fvisible", Int_Cbase_Bool) },
{ V("sc_fvisiblefrompos", Int_Vector_Vector) },
{ V("sc_isfacing", Int_Entvar_Float) },
{ V("sc_getpointsfordamage", Float_Float) },
{ V("sc_getdamagepoints", Void_Entvar_Entvar_Float) },
{ V("sc_oncreate", Void_Void) },
{ V("sc_ondestroy", Void_Void) },
{ V("sc_isvalidentity", Bool_Void) },
{ V("sc_shouldfadeondeath", Int_Void) },
{ V("sc_setupfriendly", Void_Void) },
{ V("sc_revivethink", Void_Void) },
{ V("sc_revive", Void_Void) },
{ V("sc_startmonster", Void_Void) },
{ V("sc_checkrangeattack1_move",Int_Float_Float) },
{ V("sc_checkrangeattack2_move",Int_Float_Float) },
{ V("sc_checkmeleeattack1_move",Int_Float_Float) },
{ V("sc_checkmeleeattack2_move",Int_Float_Float) },
{ V("sc_checktankusage", Int_Void) },
{ V("sc_setgaitactivity", Int_Void) },
{ V("sc_ftriangulate", Int_pVector_pVector_Float_Cbase_pVector_pVector_Bool) },
{ V("sc_ftriangulateextension", Int_pVector_pVector_Float_Cbase_pVector) },
{ V("sc_findcovergrenade", Int_Vector_Vector_Float_Float) },
{ V("sc_findcoverdistance", Int_Vector_Vector_Float_Float) },
{ V("sc_findattackpoint", Int_Vector_Vector_Float_Float) },
{ V("sc_fvalidatecover", Int_pVector) },
{ V("sc_nofriendlyfire1", Int_Void) },
{ V("sc_nofriendlyfire2", Int_Vector) },
{ V("sc_nofriendlyfire3", Int_Vector_Cbase) },
{ V("sc_nofriendlyfiretopos", Int_Vector) },
{ V("sc_fvisiblegunpos", Int_Cbase_pVector) },
{ V("sc_finbulletcone", Int_Cbase_pVector) },
{ V("sc_callgibmonster", Void_Void) },
{ V("sc_checktimebaseddamage", Void_Void) },
{ V("sc_ismoving", Int_Void) },
{ V("sc_isplayerfollowing", Int_Void) },
{ V("sc_startplayerfollowing", Void_Cbase) },
{ V("sc_stopplayerfollowing", Void_Int) },
{ V("sc_usesound", Void_Void) },
{ V("sc_unusesound", Void_Void) },
{ V("sc_ridemonster", Void_Cbase) },
{ V("sc_checkandapplygenericattacks", Void_Void) },
{ V("sc_checkscared", Bool_Void) },
{ V("sc_checkcreaturedanger", Void_Void) },
{ V("sc_checkfalldamage", Void_Void) },
{ V("sc_checkrevival", Void_Void) },
{ V("sc_mediccallsound", Void_Void) },
{ V("sc_player_menuinputperformed", Void_Bool) },
{ V("sc_player_ismenuinputdone",Bool_Void) },
{ V("sc_player_specialspawn", Void_Void) },
{ V("sc_player_isvalidinfoentity", Bool_Void) },
{ V("sc_player_levelend", Void_Void) },
{ V("sc_player_votestarted", Void_Int) },
{ V("sc_player_canstartnextvote", Bool_Int) },
{ V("sc_player_vote", Void_Int) },
{ V("sc_player_hasvoted", Bool_Void) },
{ V("sc_player_resetvote", Void_Void) },
{ V("sc_player_lastvoteinput", Int_Void) },
{ V("sc_player_initvote", Void_Void) },
{ V("sc_player_timetostartnextvote", Float_Void) },
{ V("sc_player_resetview", Void_Void) },
{ V("sc_player_getlogfrequency",Float_Void) },
{ V("sc_player_logplayerstats", Bool_Void) },
{ V("sc_player_disablecollisionwithplayer", Void_Cbase_Float) },
{ V("sc_player_enablecollisionwithplayer", Void_Cbase_Bool) },
{ V("sc_player_cantouchplayer", Bool_Cbase) },
{ V("sc_item_materialize", Void_Void) },
{ V("sc_weapon_bulletaccuracy", Vector_Vector_Vector_Vector) },
{ V("sc_weapon_tertiaryattack", Void_Void) },
{ V("sc_weapon_burstsupplement",Void_Void) },
{ V("sc_weapon_getp_model", Str_Str) },
{ V("sc_weapon_getw_model", Str_Str) },
{ V("sc_weapon_getv_model", Str_Str) },
{ V("sc_weapon_precachecustommodels", Void_Void) },
{ V("sc_weapon_ismultiplayer", Int_Void) },
{ V("sc_weapon_frunfuncs", Int_Void) },
{ V("sc_weapon_setfov", Void_Int) },
{ V("sc_weapon_fcanrun", Int_Void) },
{ V("sc_weapon_customdecrement",Void_Float) },
{ V("sc_weapon_setv_model", Void_Str) },
{ V("sc_weapon_setp_model", Void_Str) },
{ V("sc_weapon_changeweaponskin",Void_Short) },
/** New Additions (2013) **/
{ V("tfc_killed",Void_Entvar_Entvar_Int) },
{ V("tfc_istriggered", Int_Void) },
{ V("tfc_weapon_sendweaponanim", Void_Int_Int) },
{ V("tfc_weapon_getnextattackdelay", Float_Float) },
{ V("sc_takehealth",Int_Float_Int_Int) },
{ V("sc_takearmor", Int_Float_Int_Int) },
{ V("sc_giveammo", Int_Int_Str_Int_Int) },
{ V("sc_checkattacker", Int_Cbase) },
{ V("sc_player_isconnected", Int_Void) },
{ V("dod_weapon_sendweaponanim", Void_Int_Int) },
{ V("cs_weapon_isweapon", Int_Void) },
{ V("gearbox_mysquadtalkmonsterpointer", Cbase_Void) },
{ V("gearbox_weapontimebase", Float_Void) },
{ V("ts_weapon_alternateattack", Void_Void) },
{ V("item_getiteminfo", Void_ItemInfo) }
}; };
@ -300,7 +620,7 @@ static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params)
} }
// If we got here, the function is not hooked // If we got here, the function is not hooked
Hook *hook=new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].paramcount, classname); Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname);
hooks[func].push_back(hook); hooks[func].push_back(hook);
Forward *pfwd=new Forward(fwd); Forward *pfwd=new Forward(fwd);
@ -397,7 +717,7 @@ static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params)
snprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname)); snprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname));
// If we got here, the function is not hooked // If we got here, the function is not hooked
Hook *hook=new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].paramcount, classname); Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname);
hooks[func].push_back(hook); hooks[func].push_back(hook);
Forward *pfwd=new Forward(fwd); Forward *pfwd=new Forward(fwd);

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -35,6 +35,7 @@ typedef struct hook_s
int vtid; // vtable index of this function int vtid; // vtable index of this function
const char *name; // name used in the keys const char *name; // name used in the keys
bool isvoid; // whether or not the target trampoline uses voids bool isvoid; // whether or not the target trampoline uses voids
bool needsretbuf; // whether or not a pointer to a memory buffer is needed to store a return value
int paramcount; // how many parameters are in the func int paramcount; // how many parameters are in the func
void *targetfunc; // the target hook void *targetfunc; // the target hook
int (*makefunc)(AMX *, const char*); // function that creates forwards int (*makefunc)(AMX *, const char*); // function that creates forwards

File diff suppressed because it is too large Load Diff

View File

@ -1,379 +0,0 @@
/**
* Ham Sandwich module include file.
* (c) 2007, The AMX Mod X Development Team
*
* -
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/
/**
* Ham Sandwich is a module that is used to hook and call virtual functions of
* entities.
* Virtual functions are mod-specific functions. This means that in order
* for this to work on a mod, it needs to be configured with the hamdata.ini
* file.
* Be very careful with parameter passing to these functions.
*/
#if defined _hamsandwich_included
#endinput
#endif
#define _hamsandwich_included
#include <ham_const>
#if AMXX_VERSION_NUM >= 175
#pragma reqlib hamsandwich
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib hamsandwich
#endif
#else
#pragma library hamsandwich
#endif
/**
* Hooks the virtual table for the specified entity class.
* An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt");
* Look at the Ham enum for parameter lists.
*
* @param function The function to hook.
* @param EntityClass The entity classname to hook.
* @param callback The forward to call.
* @param post Whether or not to forward this in post.
* @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off.
*/
native HamHook:RegisterHam(Ham:function, const EntityClass[], const Callback[], Post=0);
/**
* Hooks the virtual table for the specified entity's class.
* An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt");
* Look at the Ham enum for parameter lists.
* Note: This will cause hooks for the entire internal class that the entity is
* not exclusively for the provided entity.
*
* @param function The function to hook.
* @param EntityId The entity classname to hook.
* @param callback The forward to call.
* @param post Whether or not to forward this in post.
* @return Returns a handle to the forward. Use EnableHamForward/DisableHamForward to toggle the forward on or off.
*/
native HamHook:RegisterHamFromEntity(Ham:function, EntityId, const Callback[], Post=0);
/**
* Stops a ham forward from triggering.
* Use the return value from RegisterHam as the parameter here!
*
* @param fwd The forward to stop.
*/
native DisableHamForward(HamHook:fwd);
/**
* Starts a ham forward back up.
* Use the return value from RegisterHam as the parameter here!
*
* @param fwd The forward to re-enable.
*/
native EnableHamForward(HamHook:fwd);
/**
* Executes the virtual function on the entity.
* Look at the Ham enum for parameter lists.
*
* @param function The function to call.
* @param id The id of the entity to execute it on.
*/
native ExecuteHam(Ham:function, this, any:...);
/**
* Executes the virtual function on the entity, this will trigger all hooks on that function.
* Be very careful about recursion!
* Look at the Ham enum for parameter lists.
*
* @param function The function to call.
* @param id The id of the entity to execute it on.
*/
native ExecuteHamB(Ham:function, this, any:...);
/**
* Gets the return status of the current hook.
* This is useful to determine what return natives to use.
*
* @return The current status of the hook (such as HAM_SUPERCEDE).
*/
native GetHamReturnStatus();
/**
* Gets the return value of a hook for hooks that return integers or booleans.
*
* @param output The variable to store the value in.
*/
native GetHamReturnInteger(&output);
/**
* Gets the return value of a hook for hooks that return float.
*
* @param output The variable to store the value in.
*/
native GetHamReturnFloat(&Float:output);
/**
* Gets the return value of a hook for hooks that return Vectors.
*
* @param output The variable to store the value in.
*/
native GetHamReturnVector(Float:output[3]);
/**
* Gets the return value of a hook for hooks that return entities.
*
* @param output The variable to store the value in. Will be -1 on null.
*/
native GetHamReturnEntity(&output);
/**
* Gets the return value of a hook for hooks that return strings.
*
* @param output The buffer to store the string in.
* @param size The string size of the buffer.
*/
native GetHamReturnString(output[], size);
/**
* Gets the original return value of a hook for hooks that return integers or booleans.
*
* @param output The variable to store the value in.
*/
native GetOrigHamReturnInteger(&output);
/**
* Gets the original return value of a hook for hooks that return floats.
*
* @param output The variable to store the value in.
*/
native GetOrigHamReturnFloat(&Float:output);
/**
* Gets the original return value of a hook for hooks that return Vectors.
*
* @param output The variable to store the value in.
*/
native GetOrigHamReturnVector(Float:output[3]);
/**
* Gets the original return value of a hook for hooks that return entities.
*
* @param output The variable to store the value in. -1 on null.
*/
native GetOrigHamReturnEntity(&output);
/**
* Gets the original return value of a hook for hooks that return strings.
*
* @param output The buffer to store the string in.
* @param size The size of the buffer.
*/
native GetOrigHamReturnString(output[], size);
/**
* Sets the return value of a hook that returns an integer or boolean.
* This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
*
* @param value The value to set the return to.
*/
native SetHamReturnInteger(value);
/**
* Sets the return value of a hook that returns a float.
* This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
*
* @param value The value to set the return to.
*/
native SetHamReturnFloat(Float:value);
/**
* Sets the return value of a hook that returns a Vector.
* This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
*
* @param value The value to set the return to.
*/
native SetHamReturnVector(const Float:value[3]);
/**
* Sets the return value of a hook that returns an entity. Set to -1 for null.
* This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
*
* @param value The value to set the return to.
*/
native SetHamReturnEntity(value);
/**
* Sets the return value of a hook that returns a string.
* This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
*
* @param value The value to set the return to.
*/
native SetHamReturnString(const value[]);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are integers.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamInteger(which, value);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are floats.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamFloat(which, Float:value);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are Vectors.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamVector(which, const Float:value[3]);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are entities.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamEntity(which, value);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are strings.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamString(which, const output[]);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are trace result handles.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to.
*/
native SetHamParamTraceResult(which, tr_handle);
/**
* Returns whether or not the function for the specified Ham is valid.
* Things that would make it invalid would be bounds (an older module version
* may not have all of the functions), and the function not being found in
* the mod's hamdata.ini file.
*
* @param function The function to look up.
* @return true if the function is valid, false otherwise.
*/
native bool:IsHamValid(Ham:function);
/**
* This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
* This requires the mod to have the pev and base fields set in hamdata.ini.
* Note this dereferences memory! Improper use of this will crash the server.
* This will return an index of the corresponding cbase field in private data.
* Returns -1 on a null entry.
*
* @param id The entity to examine the private data.
* @param offset The windows offset of the data.
* @param linuxdiff The linux difference of the data.
* @return The index of the corresponding pdata field. -1 for none set.
*/
native get_pdata_cbase(id, offset, linuxdiff=5);
/**
* This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
* This requires the mod to have the pev and base fields set in hamdata.ini.
* This will set the corresponding cbase field in private data with the index.
* Pass -1 to null the entry.
*
* @param id The entity to examine the private data.
* @param offset The windows offset of the data.
* @param value The index to store, -1 for invalid
* @param linuxdiff The linux difference of the data.
*/
native set_pdata_cbase(id, offset, value, linuxdiff=5);
/**
* This is similar to the get_pdata_cbase, however it does not dereference memory.
* This is many times slower than get_pdata_cbase, and this should only be used
* for testing and finding of offsets, not actual release quality plugins.
* This will return an index of the corresponding cbase field in private data.
* Returns -1 on a null entry. -2 on an invalid entry.
*
* @param id Entry to examine the private data.
* @param offset The windows offset of the data.
* @param linuxdiff The linux difference of the data.
* @return The index of the corresponding pdata field, -1 for null, -2 for invalid.
*/
native get_pdata_cbase_safe(id, offset, linuxdiff=5);
// This is the callback from the module, this handles any fatal errors.
// This will in turn call the "HamFilter(Ham:id, HamError:err, const reason[])" public, if it exists.
// Return PLUGIN_HANDLED from within the HamFilter to stop the plugin from failing.
// Any other return value will fail the plugin.
// You do not need to have a HamFilter, if there is none, all fatal errors will fail the plugin.
// Do not modify this!
public __fatal_ham_error(Ham:id, HamError:err, const reason[])
{
new func=get_func_id("HamFilter", -1);
new bool:fail=true;
if (func != -1 && callfunc_begin_i(func, -1)==1)
{
callfunc_push_int(_:id);
callfunc_push_int(_:err);
callfunc_push_str(reason, false);
if (callfunc_end()==PLUGIN_HANDLED)
{
fail=false;
}
}
if (fail)
{
set_fail_state(reason);
}
}

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it

View File

@ -56,7 +56,7 @@
#define FN_AMXX_ATTACH OnAmxxAttach #define FN_AMXX_ATTACH OnAmxxAttach
/** AMXX Detach (unload) */ /** AMXX Detach (unload) */
//#define FN_AMXX_DETACH OnAmxxDetach #define FN_AMXX_DETACH OnAmxxDetach
/** All plugins loaded /** All plugins loaded
* Do forward functions init here (MF_RegisterForward) * Do forward functions init here (MF_RegisterForward)

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it
@ -137,4 +137,3 @@ void HamCommand(void)
print_srvconsole(" %-22s - %s\n", "list", "list all keys and their values from the config file."); print_srvconsole(" %-22s - %s\n", "list", "list all keys and their values from the config file.");
print_srvconsole(" %-22s - %s\n", "hooks", "list all active hooks"); print_srvconsole(" %-22s - %s\n", "hooks", "list all active hooks");
} }

View File

@ -1,5 +1,5 @@
/* Ham Sandwich /* Ham Sandwich
* Copyright 2007 * Copyright 2007-2014
* By the AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* Ham Sandwich is free software; you can redistribute it and/or modify it * Ham Sandwich is free software; you can redistribute it and/or modify it

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,23 @@
/** /* Ham Sandwich
* Ham Sandwich module include file. * Copyright 2007-2014
* (c) 2007, The AMX Mod X Development Team * By the AMX Mod X Development Team
* *
* - * Ham Sandwich is free software; you can redistribute it and/or modify it
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the * under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at * Free Software Foundation; either version 2 of the License, or (at
* your option) any later version. * your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * Ham Sandwich is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation, * along with Ham Sandwich; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
* In addition, as a special exception, the author gives permission to * In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL * link the code of Ham Sandwich with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve, * Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all * L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs * respects for all of the code used other than the HL Engine and MODs
@ -280,7 +279,7 @@ native SetHamParamEntity(which, value);
* Use this on parameters that are strings. * Use this on parameters that are strings.
* *
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to. * @param ouput The value to change it to.
*/ */
native SetHamParamString(which, const output[]); native SetHamParamString(which, const output[]);
@ -289,10 +288,58 @@ native SetHamParamString(which, const output[]);
* Use this on parameters that are trace result handles. * Use this on parameters that are trace result handles.
* *
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this". * @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param value The value to change it to. * @param tr_handle The value to change it to.
*/ */
native SetHamParamTraceResult(which, tr_handle); native SetHamParamTraceResult(which, tr_handle);
/**
* Sets a parameter on the fly of the current hook. This has no effect in post hooks.
* Use this on parameters that are trace result handles.
*
* @param which Which parameter to change. Starts at 1, and works up from the left to right. 1 is always "this".
* @param iteminfo_handle The value to change it to.
*/
native SetHamParamItemInfo(which, iteminfo_handle);
/**
* Gets a parameter on the fly of the current hook.
* Use this on parameters that are iteminfo result handles.
*
* @param iteminfo_handle Item info handle.
* @param type Item info type. See ItemInfo_ constants.
*/
native GetHamItemInfo(iteminfo_handle, ItemInfo:type, any:...);
/**
* Sets a parameter on the fly of the current hook.
* Use this on parameters that are iteminfo result handles.
*
* @param iteminfo_handle Item info handle.
* @param type Item info type. See HamItemInfo_ constants.
*/
native SetHamItemInfo(iteminfo_handle, ItemInfo:type, any:...);
/**
* Creates an ItemInfo handle. This value should never be altered.
* The handle can be used in Get/SetHamItemInfo.
*
* NOTE: You must call FreeHamItemInfo() on every handle made with CreateHamItemInfo().
*
* @return A new ItemInfo handle.
*/
native CreateHamItemInfo();
/**
* Frees an ItemIndo handle created with CreateHamItemInfo(). Do not call
* this more than once per handle, or on handles not created through
* CreateHamItemInfo().
*
* @param itemInfo_handle ItemInfo handle created via CreateHamItemInfo().
* @noreturn
*/
native FreeHamItemInfo(itemInfo_handle);
/** /**
* Returns whether or not the function for the specified Ham is valid. * Returns whether or not the function for the specified Ham is valid.