File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -821,7 +821,11 @@ void InitBasicEventListeners() {
821821 // LLSE Registered Cmd
822822
823823 bool callbackRes = CallServerCmdCallback (prefix, paras);
824- IF_LISTENED (EVENT_TYPES::onConsoleCmd) { CallEvent (EVENT_TYPES::onConsoleCmd, String::newString (cmd)); }
824+ IF_LISTENED (EVENT_TYPES::onConsoleCmd) {
825+ if (!CallEvent (EVENT_TYPES::onConsoleCmd, String::newString (cmd))) {
826+ ev.cancel ();
827+ }
828+ }
825829 IF_LISTENED_END (EVENT_TYPES::onConsoleCmd);
826830 if (!callbackRes) {
827831 ev.cancel ();
@@ -854,7 +858,13 @@ void InitBasicEventListeners() {
854858 if (static_cast <int >(permission_level) >= perm) {
855859 bool callbackRes = CallPlayerCmdCallback (player, prefix, paras);
856860 IF_LISTENED (EVENT_TYPES::onPlayerCmd) {
857- CallEvent (EVENT_TYPES::onPlayerCmd, PlayerClass::newPlayer (player), String::newString (cmd));
861+ if (!CallEvent (
862+ EVENT_TYPES::onPlayerCmd,
863+ PlayerClass::newPlayer (player),
864+ String::newString (cmd)
865+ )) {
866+ ev.cancel ();
867+ }
858868 }
859869 IF_LISTENED_END (EVENT_TYPES::onPlayerCmd);
860870 if (!callbackRes) {
You can’t perform that action at this time.
0 commit comments