diff options
author | shennetsind <ind@henn.et> | 2013-02-14 19:13:14 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-02-14 19:22:56 -0200 |
commit | 82005a99f5b1cca68e9fb1ac6b1614c815e4bd45 (patch) | |
tree | 219766035a17c63286c5be2b3699a07868810b21 /src/map/script.c | |
parent | ef503ce5ad834d4601d6420bddf85655b6428c24 (diff) | |
download | hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.gz hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.bz2 hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.tar.xz hercules-82005a99f5b1cca68e9fb1ac6b1614c815e4bd45.zip |
Introducing Git Hash
Added 'Git Hash' way to identify where you last updated your working copy (it won't detect your local changes' hash -- intended). Also Implemented HERC_UNKNOWN_VER, a simple way to detect whether get_svn_revision or get_git_hash failed to detect (before you'd need to strncmp for "unknown" or similars)
Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c index 83b6c1a68..fe00599a6 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -16992,10 +16992,10 @@ BUILDIN_FUNC(is_function) { * get_revision() -> retrieves the current svn revision (if available) **/ BUILDIN_FUNC(get_revision) { - const char * revision; + const char *svn = get_svn_revision(); - if ( (revision = get_svn_revision()) != 0 ) - script_pushint(st,atoi(revision)); + if ( svn[0] != HERC_UNKNOWN_VER ) + script_pushint(st,atoi(svn)); else script_pushint(st,-1);//unknown |