summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-14 13:33:33 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-14 13:33:33 +0300
commit8cbdcf9c92c8e9af767afd666733227dd68dddd3 (patch)
tree93ba6556f2449e2219d80ba284d5f66c0e06dac0 /src/common
parentfe6599de91dbab781e37fbded66cfecb685041cf (diff)
downloadhercules-8cbdcf9c92c8e9af767afd666733227dd68dddd3.tar.gz
hercules-8cbdcf9c92c8e9af767afd666733227dd68dddd3.tar.bz2
hercules-8cbdcf9c92c8e9af767afd666733227dd68dddd3.tar.xz
hercules-8cbdcf9c92c8e9af767afd666733227dd68dddd3.zip
Add ability to add deprecated command from scripts and plugins.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/HPMi.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 485586f6f..a7435b437 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -136,10 +136,16 @@ enum HPluginConfType {
/* HPMi->addScript */
#define addScriptCommand(cname,scinfo,funcname) \
if ( HPMi->addScript != NULL ) { \
- HPMi->addScript(cname,scinfo,buildin_ ## funcname); \
+ HPMi->addScript(cname,scinfo,buildin_ ## funcname, false); \
} else { \
ShowWarning("HPM (%s):addScriptCommand(\"%s\",\"%s\",%s) failed, addScript sub is NULL!\n",pinfo.name,cname,scinfo,# funcname);\
}
+#define addScriptCommandDeprecated(cname,scinfo,funcname) \
+ if ( HPMi->addScript != NULL ) { \
+ HPMi->addScript(cname,scinfo,buildin_ ## funcname, true); \
+ } else { \
+ ShowWarning("HPM (%s):addScriptCommandDeprecated(\"%s\",\"%s\",%s) failed, addScript sub is NULL!\n",pinfo.name,cname,scinfo,# funcname);\
+ }
/* HPMi->addCPCommand */
#define addCPCommand(cname,funcname) \
if ( HPMi->addCPCommand != NULL ) { \
@@ -162,7 +168,7 @@ HPExport struct HPMi_interface {
/* */
void (*event[HPET_MAX]) (void);
bool (*addCommand) (char *name, bool (*func)(const int fd, struct map_session_data* sd, const char* command, const char* message,struct AtCommandInfo *info));
- bool (*addScript) (char *name, char *args, bool (*func)(struct script_state *st));
+ bool (*addScript) (char *name, char *args, bool (*func)(struct script_state *st), bool isDeprecated);
void (*addCPCommand) (char *name, CParseFunc func);
/* HPM Custom Data */
void (*addToHPData) (enum HPluginDataTypes type, unsigned int pluginID, void *ptr, void *data, unsigned int index, bool autofree);