🔥 Remove backwards compatible CreateMultiForwardEx

This commit is contained in:
xPaw 2014-06-05 23:33:45 +03:00
parent 9b1f4e01c7
commit 2e6dc308a8
5 changed files with 8 additions and 47 deletions

View File

@ -33,7 +33,7 @@
#include "debugger.h"
#include "binlog.h"
CForward::CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam *paramTypes, int fwd_type)
CForward::CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam *paramTypes)
{
m_FuncName = name;
m_ExecType = et;
@ -47,13 +47,6 @@ CForward::CForward(const char *name, ForwardExecType et, int numParams, const Fo
for (CPluginMngr::iterator iter = g_plugins.begin(); iter; ++iter)
{
if ((fwd_type != FORWARD_ALL) &&
((fwd_type == FORWARD_ONLY_NEW && ((*iter).getAMX()->flags & AMX_FLAG_OLDFILE))
|| (fwd_type == FORWARD_ONLY_OLD && !((*iter).getAMX()->flags & AMX_FLAG_OLDFILE))
))
{
continue;
}
if ((*iter).isValid() && amx_FindPublic((*iter).getAMX(), name, &func) == AMX_ERR_NONE)
{
AMXForward tmp;
@ -367,10 +360,10 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays)
return retVal;
}
int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam * paramTypes, int fwd_type)
int CForwardMngr::registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam * paramTypes)
{
int retVal = m_Forwards.size() << 1;
CForward *tmp = new CForward(funcName, et, numParams, paramTypes, fwd_type);
CForward *tmp = new CForward(funcName, et, numParams, paramTypes);
if (!tmp)
{
@ -590,7 +583,7 @@ int CForwardMngr::isSameSPForward(int id1, int id2)
&& (fwd1->m_NumParams == fwd2->m_NumParams));
}
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num, int fwd_type)
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num)
{
ForwardParam params[FORWARD_MAX_PARAMS];
@ -599,7 +592,7 @@ int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_
params[i] = static_cast<ForwardParam>(list[i]);
}
return g_forwards.registerForward(funcName, et, num, params, fwd_type);
return g_forwards.registerForward(funcName, et, num, params);
}
int registerForward(const char *funcName, ForwardExecType et, ...)

View File

@ -51,10 +51,6 @@
const int FORWARD_MAX_PARAMS = 32;
#define FORWARD_ONLY_OLD 1
#define FORWARD_ONLY_NEW 2
#define FORWARD_ALL 3
enum ForwardExecType
{
ET_IGNORE = 0, // Ignore return vaue
@ -111,7 +107,7 @@ class CForward
ForwardParam m_ParamTypes[FORWARD_MAX_PARAMS];
public:
CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam * paramTypes, int fwd_type=FORWARD_ALL);
CForward(const char *name, ForwardExecType et, int numParams, const ForwardParam * paramTypes);
CForward() {} // leaves everything unitialized'
cell execute(cell *params, ForwardPreparedArray *preparedArrays);
@ -209,7 +205,7 @@ public:
// Interface
// Register normal forward
int registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam *paramTypes, int fwd_type=FORWARD_ALL);
int registerForward(const char *funcName, ForwardExecType et, int numParams, const ForwardParam *paramTypes);
// Register single plugin forward
int registerSPForward(const char *funcName, AMX *amx, int numParams, const ForwardParam * paramTypes);
int registerSPForward(int func, AMX *amx, int numParams, const ForwardParam * paramTypes);
@ -235,7 +231,7 @@ public:
// (un)register forward
int registerForward(const char *funcName, ForwardExecType et, ...);
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num, int fwd_type=FORWARD_ALL);
int registerForwardC(const char *funcName, ForwardExecType et, cell *list, size_t num);
int registerSPForwardByName(AMX *amx, const char *funcName, ...);
int registerSPForwardByNameC(AMX *amx, const char *funcName, cell *list, size_t num);
int registerSPForward(AMX *amx, int func, ...);

View File

@ -4325,21 +4325,6 @@ static cell AMX_NATIVE_CALL CreateMultiForward(AMX *amx, cell *params)
return registerForwardC(funcname, static_cast<ForwardExecType>(params[2]), ps, count-2);
}
static cell AMX_NATIVE_CALL CreateMultiForwardEx(AMX *amx, cell *params)
{
int len;
char *funcname = get_amxstring(amx, params[1], 0, len);
cell ps[FORWARD_MAX_PARAMS];
cell count = params[0] / sizeof(cell);
for (cell i=4; i<=count; i++)
{
ps[i-4] = *get_amxaddr(amx, params[i]);
}
return registerForwardC(funcname, static_cast<ForwardExecType>(params[2]), ps, count-3, params[3]);
}
static cell AMX_NATIVE_CALL CreateOneForward(AMX *amx, cell *params)
{
CPluginMngr::CPlugin *p = g_plugins.findPlugin(params[1]);
@ -5023,7 +5008,6 @@ AMX_NATIVE_INFO amxmodx_Natives[] =
{"CreateHudSyncObj", CreateHudSyncObj},
{"CreateLangKey", CreateLangKey},
{"CreateMultiForward", CreateMultiForward},
{"CreateMultiForwardEx", CreateMultiForwardEx},
{"CreateOneForward", CreateOneForward},
{"DestroyForward", DestroyForward},
{"ExecuteForward", ExecuteForward},

View File

@ -302,10 +302,6 @@ enum {
#define FP_STRING 2
#define FP_ARRAY 4
#define FORWARD_ONLY_OLD 1
#define FORWARD_ONLY_NEW 2
#define FORWARD_ALL 3
#define SND_SPAWNING (1<<8) // we're spawing, used in some cases for ambients
#define SND_STOP (1<<5) // stop sound
#define SND_CHANGE_VOL (1<<6) // change sound vol

View File

@ -1086,14 +1086,6 @@ native set_addr_val(addr, val);
*/
native CreateMultiForward(const name[], stop_type, ...);
/**
* Creates a multi-forward plugin that can filter between old/new plugins.
* Old plugins are used by the AMX Mod backwards compatibility layer.
* Stop type must be one of the ET_ values in amxconst.inc
* Forward type must be one of the FORWARD_ values in amxconst.inc.
*/
native CreateMultiForwardEx(const name[], stop_type, forward_type, ...);
/**
* Creates a forward for one plugin.
* Results will be > 0 for success.