diff options
author | Haru <haru@dotalux.com> | 2020-05-04 05:53:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 05:53:04 +0200 |
commit | 292b9c9444b2dd59e06689ded9bdebc10242a641 (patch) | |
tree | 56e34e8e240104d318476a3a45790cb11bcdcbc7 | |
parent | 35425ce13ee5c7dd2132413ccc397d059da9153e (diff) | |
parent | 967c5f6ccd2dadcaff54041f4cd7c9a0cd3fb9e5 (diff) | |
download | hercules-292b9c9444b2dd59e06689ded9bdebc10242a641.tar.gz hercules-292b9c9444b2dd59e06689ded9bdebc10242a641.tar.bz2 hercules-292b9c9444b2dd59e06689ded9bdebc10242a641.tar.xz hercules-292b9c9444b2dd59e06689ded9bdebc10242a641.zip |
Merge pull request #2062 from AnnieRuru/36-PCBLOCK_COMMANDS
Fix *atcommand cannot be use when PCBLOCK_COMMANDS is true
-rw-r--r-- | src/map/atcommand.c | 4 | ||||
-rw-r--r-- | src/map/script.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 00073e544..3fe6c8581 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -10565,9 +10565,9 @@ static bool atcommand_exec(const int fd, struct map_session_data *sd, const char clif->message(fd, msg_fd(fd,143)); return false; } + if (sd->block_action.commands) // *pcblock script command + return false; } - if (sd->block_action.commands) // *pcblock script command - return false; if (*message == atcommand->char_symbol) is_atcommand = false; diff --git a/src/map/script.c b/src/map/script.c index 5cdd16367..45c954dc0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16111,7 +16111,6 @@ static BUILDIN(atcommand) struct map_session_data *sd, *dummy_sd = NULL; int fd; const char* cmd; - bool ret = true; cmd = script_getstr(st,2); @@ -16134,11 +16133,12 @@ static BUILDIN(atcommand) if (!atcommand->exec(fd, sd, cmd, false)) { ShowWarning("script: buildin_atcommand: failed to execute command '%s'\n", cmd); - script->reportsrc(st); - ret = false; + if (dummy_sd != NULL) + aFree(dummy_sd); + return false; } if (dummy_sd) aFree(dummy_sd); - return ret; + return true; } /** |