summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 12:07:37 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-02 12:07:37 +0000
commitb6d61b6247ec5409d71162f1b052b2b4d621941e (patch)
tree6621e64d05ad29aaf1ed061f204cd6a478612766 /src/map
parent7a6a64ab45ec95ae8c547a7fd3cedd7e7546cdc8 (diff)
downloadhercules-b6d61b6247ec5409d71162f1b052b2b4d621941e.tar.gz
hercules-b6d61b6247ec5409d71162f1b052b2b4d621941e.tar.bz2
hercules-b6d61b6247ec5409d71162f1b052b2b4d621941e.tar.xz
hercules-b6d61b6247ec5409d71162f1b052b2b4d621941e.zip
Fixed one wrong return value in buildin_getcharid (bugreport:33)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11638 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/script.c b/src/map/script.c
index c9859de1a..0a308d3e6 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -5879,24 +5879,25 @@ BUILDIN_FUNC(getcharid)
int num;
TBL_PC *sd;
- num=script_getnum(st,2);
+ num = script_getnum(st,2);
if( script_hasdata(st,3) )
sd=map_nick2sd(script_getstr(st,3));
else
- sd=script_rid2sd(st);
- if(sd==NULL || num<0 || num>3){
+ sd=script_rid2sd(st);
+
+ if(sd==NULL){
script_pushint(st,0); //return 0, according docs
return 0;
}
- switch (num) {
+ switch( num ) {
case 0: script_pushint(st,sd->status.char_id); break;
case 1: script_pushint(st,sd->status.party_id); break;
case 2: script_pushint(st,sd->status.guild_id); break;
case 3: script_pushint(st,sd->status.account_id); break;
default:
- ShowError("buildin_getcharid: invalid .\n");
- script_pushconststr(st,"");
+ ShowError("buildin_getcharid: invalid parameter (%d).\n", num);
+ script_pushint(st,0);
break;
}