summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/messages.conf5
-rw-r--r--src/map/atcommand.c15
2 files changed, 12 insertions, 8 deletions
diff --git a/conf/messages.conf b/conf/messages.conf
index 7666badf3..e21c41176 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -1242,8 +1242,9 @@
1294: They are family... wish them luck.
// @version
-1295: Hercules Git Hash r%s
-1296: Cannot determine Git Hash.
+1295: Git Hash '%s'
+1296: Cannot determine version.
+1436: SVN r%s
// @mutearea
1297: Please enter a time in minutes (usage: @mutearea/@stfu <time in minutes>).
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d878de709..7fc998628 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -7369,15 +7369,18 @@ ACMD_FUNC(whereis)
return 0;
}
-ACMD_FUNC(version)
-{
- const char * revision;
+ACMD_FUNC(version) {
+ const char *git = get_git_hash();
+ const char *svn = get_svn_revision();
- if ((revision = get_svn_revision()) != 0) {
- sprintf(atcmd_output,msg_txt(1295),revision); // rAthena Version SVN r%s
+ if ( git[0] != HERC_UNKNOWN_VER ) {
+ sprintf(atcmd_output,msg_txt(1295),git); // Git Hash '%s'
+ clif->message(fd,atcmd_output);
+ } else if ( svn[0] != HERC_UNKNOWN_VER ) {
+ sprintf(atcmd_output,msg_txt(1436),git); // SVN r%s
clif->message(fd,atcmd_output);
} else
- clif->message(fd,msg_txt(1296)); // Cannot determine SVN revision.
+ clif->message(fd,msg_txt(1296)); // Cannot determine version
return 0;
}