From 27dccdda376b242d142bc549b74deea26773bde9 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 6 Apr 2013 21:01:22 -0300 Subject: Fixed @version Added existent Hybrid GIT/SVN support to @version. Special Thanks to Zopokx for pointing it out. Signed-off-by: shennetsind --- src/map/atcommand.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-70-g09d2