summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-04-06 21:01:22 -0300
committershennetsind <ind@henn.et>2013-04-06 21:01:22 -0300
commit27dccdda376b242d142bc549b74deea26773bde9 (patch)
tree12b4db81e4014caaa1f044da658d4f5d8415dee1
parent16dfef6c5fe28d9008a304d4f5f650d7ac1dfbcd (diff)
downloadhercules-27dccdda376b242d142bc549b74deea26773bde9.tar.gz
hercules-27dccdda376b242d142bc549b74deea26773bde9.tar.bz2
hercules-27dccdda376b242d142bc549b74deea26773bde9.tar.xz
hercules-27dccdda376b242d142bc549b74deea26773bde9.zip
Fixed @version
Added existent Hybrid GIT/SVN support to @version. Special Thanks to Zopokx for pointing it out. Signed-off-by: shennetsind <ind@henn.et>
-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;
}