summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-07-03 01:59:42 -0300
committerJesusaves <cpntb1@ymail.com>2020-07-03 01:59:42 -0300
commitcc502ef1a307d107389cd847c1be715e688492a4 (patch)
tree1a2e247e6b81372c7446c1727b08fdcd4e6daf4c /src
parenta10396f732af5c546bd933c0cb5ec90cff99cd28 (diff)
downloadevol-hercules-cc502ef1a307d107389cd847c1be715e688492a4.tar.gz
evol-hercules-cc502ef1a307d107389cd847c1be715e688492a4.tar.bz2
evol-hercules-cc502ef1a307d107389cd847c1be715e688492a4.tar.xz
evol-hercules-cc502ef1a307d107389cd847c1be715e688492a4.zip
Fix getskillname
Diffstat (limited to 'src')
-rw-r--r--src/emap/script_buildins.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 275bfff..467ccf2 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -3287,8 +3287,13 @@ BUILDIN(resetrng)
BUILDIN(getskillname)
{
int skill_id = script_getnum(st, 2);
- const char* name = skill->get_desc(skill_id);
- script_pushstr(st, (char*)(name));
+
+ if (skill_id < 0) {
+ script_pushstr(st, "");
+ return false;
+ }
+
+ script_pushstrcopy(st, skill->get_desc(skill_id));
return true;
}