summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatias <matiassw@gmail.com>2013-06-25 03:01:07 -0400
committerMatias <matiassw@gmail.com>2013-06-25 03:01:07 -0400
commit884424e83290729598f57502e9a273f502bc1b50 (patch)
treecf4923b4cd61661a7cb2b3c93488dd460645aee5
parent7c81bc0fb6817748ea38cd1bbd440a1c46811131 (diff)
downloadhercules-884424e83290729598f57502e9a273f502bc1b50.tar.gz
hercules-884424e83290729598f57502e9a273f502bc1b50.tar.bz2
hercules-884424e83290729598f57502e9a273f502bc1b50.tar.xz
hercules-884424e83290729598f57502e9a273f502bc1b50.zip
- Fixing "@channel ban" not working if the target name has a space after the first char
-rw-r--r--src/map/atcommand.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 65da7aa24..050e2f572 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9017,11 +9017,17 @@ ACMD(channel) {
return false;
}
- if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) {
- sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found
- clif->message(fd, atcmd_output);
- return false;
+ if (!message || !*message || sscanf(message, "%s %s %24[^\n]", key, sub1, sub2) < 1) {
+ sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found
+ clif->message(fd, atcmd_output);
+ return false;
}
+
+ if( sub2[0] == '\0' || ( pl_sd = map_nick2sd(sub2) ) == NULL ) {
+ sprintf(atcmd_output, msg_txt(1434), sub2);// Player '%s' was not found
+ clif->message(fd, atcmd_output);
+ return false;
+ }
if( pc_has_permission(pl_sd, PC_PERM_HCHSYS_ADMIN) ) {
clif->message(fd, msg_txt(1464)); // Ban failed, not possible to ban this user.