summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-02-22 00:08:06 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-13 09:58:07 +0100
commit8a7dbf58b05fab38e45f8c538fd104a3b172b82a (patch)
tree9b61de4b8f9fccc06a2e940fcc6d1a6304bd1b88
parent2d357188c0ff56234ad54d619ece7450ed8b247e (diff)
downloadhercules-8a7dbf58b05fab38e45f8c538fd104a3b172b82a.tar.gz
hercules-8a7dbf58b05fab38e45f8c538fd104a3b172b82a.tar.bz2
hercules-8a7dbf58b05fab38e45f8c538fd104a3b172b82a.tar.xz
hercules-8a7dbf58b05fab38e45f8c538fd104a3b172b82a.zip
Apply code style to ACMD(fakename) function
-rw-r--r--src/map/atcommand.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index cafe3e39f..df851bbcc 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7845,26 +7845,31 @@ ACMD(monsterignore)
return true;
}
-/*==========================================
- * @fakename
- * => Gives your character a fake name. [Valaris]
- *------------------------------------------*/
+
+/**
+ * Temporarily changes the character's name to the specified string.
+ *
+ * @code{.herc}
+ * @fakename {<options>} {<fake_name>}
+ * @endcode
+ *
+ **/
ACMD(fakename)
{
- if (!*message)
- {
- if (sd->fakename[0])
- {
+ if (*message == '\0') {
+ if (sd->fakename[0] != '\0') {
sd->fakename[0] = '\0';
sd->fakename_options = FAKENAME_OPTION_NONE;
clif->blname_ack(0, &sd->bl);
- if( sd->disguise )
+
+ if (sd->disguise != 0) // Another packet should be sent so the client updates the name for sd.
clif->blname_ack(sd->fd, &sd->bl);
- clif->message(sd->fd, msg_fd(fd,1307)); // Returned to real name.
+
+ clif->message(sd->fd, msg_fd(fd, 1307)); // Returned to real name.
return true;
}
- clif->message(sd->fd, msg_fd(fd,1308)); // You must enter a name.
+ clif->message(sd->fd, msg_fd(fd, 1308)); // You must enter a name.
return false;
}
@@ -7879,9 +7884,8 @@ ACMD(fakename)
fake_name = message;
}
- if (strlen(fake_name) < 2)
- {
- clif->message(sd->fd, msg_fd(fd,1309)); // Fake name must be at least two characters.
+ if (strlen(fake_name) < 2) {
+ clif->message(sd->fd, msg_fd(fd, 1309)); // Fake name must be at least two characters.
return false;
}
@@ -7891,9 +7895,11 @@ ACMD(fakename)
safestrncpy(sd->fakename, fake_name, sizeof(sd->fakename));
sd->fakename_options = options;
clif->blname_ack(0, &sd->bl);
- if (sd->disguise) // Another packet should be sent so the client updates the name for sd
+
+ if (sd->disguise != 0) // Another packet should be sent so the client updates the name for sd.
clif->blname_ack(sd->fd, &sd->bl);
- clif->message(sd->fd, msg_fd(fd,1310)); // Fake name enabled.
+
+ clif->message(sd->fd, msg_fd(fd, 1310)); // Fake name enabled.
return true;
}