diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-15 17:48:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-15 17:48:06 +0300 |
commit | 36f39a0992266632465b4e8f50acc0f09cd0c30d (patch) | |
tree | b608bcd048d37707cb00a388dd61cab98ccc985c /src/map/script.c | |
parent | 77db5d34b091c366750410281369ff4ce926b9b6 (diff) | |
download | plugin-36f39a0992266632465b4e8f50acc0f09cd0c30d.tar.gz plugin-36f39a0992266632465b4e8f50acc0f09cd0c30d.tar.bz2 plugin-36f39a0992266632465b4e8f50acc0f09cd0c30d.tar.xz plugin-36f39a0992266632465b4e8f50acc0f09cd0c30d.zip |
Fix returns from script functions.
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c index 54bf82c..67ab95a 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -32,18 +32,21 @@ BUILDIN(getClientVersion) { getDataReturn(0); script_pushint(st, data->clientVersion); + return true; } BUILDIN(getLang) { getDataReturn(0); script_pushint(st, data->language); + return true; } BUILDIN(setLang) { getData(); data->language = script_getnum(st, 2); + return true; } BUILDIN(setCamNpc) @@ -61,12 +64,12 @@ BUILDIN(setCamNpc) else { if (!st->oid) - return 1; + return false; nd = (struct npc_data *) map->id2bl (st->oid); } if (!nd || sd->bl.m != nd->bl.m) - return 1; + return false; if (script_hasdata(st, 3) && script_hasdata(st, 4)) { @@ -76,14 +79,14 @@ BUILDIN(setCamNpc) send_npccommand2(script->rid2sd (st), st->oid, 2, nd->bl.id, x, y); - return 0; + return true; } BUILDIN(restoreCam) { getSD(); send_npccommand(sd, st->oid, 3); - return 0; + return true; } BUILDIN(npcTalk3) @@ -106,7 +109,7 @@ BUILDIN(npcTalk3) } if (!nd) - return 0; + return false; msg = nd->name; // +++ after restore lang support need translate here @@ -117,7 +120,7 @@ BUILDIN(npcTalk3) msg = nd->name; */ if (strlen(str) + strlen(msg) > 450) - return 0; + return false; if (nd) { @@ -127,4 +130,6 @@ BUILDIN(npcTalk3) strcat (message, str); send_local_message (sd, &(nd->bl), message); } + + return true; } |