summaryrefslogtreecommitdiff
path: root/npc/functions/main.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/functions/main.txt')
-rw-r--r--npc/functions/main.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/npc/functions/main.txt b/npc/functions/main.txt
index 81204400..1ae37a35 100644
--- a/npc/functions/main.txt
+++ b/npc/functions/main.txt
@@ -14,12 +14,14 @@
* @return the account id
*/
function script nameid2id {
- if (getdatatype(getarg(0, "")) & DATATYPE_STR != 0) {
+ if ((getdatatype(getarg(0, "")) & DATATYPE_STR) != 0) {
if (getarg(0, "") == "") {
return playerattached();
} else {
return getcharid(CHAR_ID_ACCOUNT, getarg(0));
}
+ } else if (getarg(0) == 0) {
+ return playerattached();
} else {
return getarg(0);
}