diff options
author | Haru <haru@dotalux.com> | 2016-08-02 01:35:41 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-08-19 21:32:28 +0200 |
commit | 4e5b040d9db0e4dee576149c53fba070372b51c2 (patch) | |
tree | f3424b4a576ea5d44a1e1f29361d028e805d52c5 /src/plugins | |
parent | 67a84ce174851ed866b99737eec6bd0adfca6617 (diff) | |
download | hercules-4e5b040d9db0e4dee576149c53fba070372b51c2.tar.gz hercules-4e5b040d9db0e4dee576149c53fba070372b51c2.tar.bz2 hercules-4e5b040d9db0e4dee576149c53fba070372b51c2.tar.xz hercules-4e5b040d9db0e4dee576149c53fba070372b51c2.zip |
Added option to make plugin-defined battle config entries optional
When a setting optional, no warning is issued on the console when said setting is not found in the config
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sample.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/sample.c b/src/plugins/sample.c index b1ff4b39f..b37f7c4f7 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -213,11 +213,12 @@ HPExport void plugin_init (void) { } } /* triggered when server starts loading, before any server-specific data is set */ -HPExport void server_preinit (void) { +HPExport void server_preinit(void) +{ /* makes map server listen to mysetting:value in any "battleconf" file (including imported or custom ones) */ /* value is not limited to numbers, its passed to our plugins handler (parse_my_setting) as const char *, * however for battle config to be returned to our script engine we need it to be number (int) so keep use it as int only */ - addBattleConf("my_setting",parse_my_setting,return_my_setting); + addBattleConf("my_setting", parse_my_setting, return_my_setting, false); } /* run when server is ready (online) */ HPExport void server_online (void) { |