summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-30 12:01:59 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-05-30 12:01:59 +0000
commitdd86a2c6688faa2229e3c72827d329e4d854d1c5 (patch)
tree190bc05eb3cd8320f803818de81c5227e9f89b00 /src/map/script.c
parent81b0693fe117080673fb252f297b14e61a550e5d (diff)
downloadhercules-dd86a2c6688faa2229e3c72827d329e4d854d1c5.tar.gz
hercules-dd86a2c6688faa2229e3c72827d329e4d854d1c5.tar.bz2
hercules-dd86a2c6688faa2229e3c72827d329e4d854d1c5.tar.xz
hercules-dd86a2c6688faa2229e3c72827d329e4d854d1c5.zip
- Cleanups and a little fix to NPC Sizes (thanks to ultramage).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12745 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/map/script.c b/src/map/script.c
index b1885722c..ebe02db0f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -11662,26 +11662,17 @@ BUILDIN_FUNC(setnpcdisplay)
name = script_getstr(st,2);
data = script_getdata(st,3);
- get_val(st, data);
+
if( script_hasdata(st,5) )
- {
- newname = conv_str(st,data);
- class_ = script_getnum(st,4);
size = script_getnum(st,5);
- }
if( script_hasdata(st,4) )
- {
- newname = conv_str(st,data);
class_ = script_getnum(st,4);
- }
- else if( data_isstring(data) )
- {
- newname = conv_str(st,data);
- }
+
+ get_val(st, data);
+ if( data_isstring(data) )
+ newname = conv_str(st,data);
else if( data_isint(data) )
- {
- class_ = conv_num(st,data);
- }
+ class_ = conv_num(st,data);
else
{
ShowError("script:setnpcdisplay: expected a string or number\n");
@@ -11705,7 +11696,7 @@ BUILDIN_FUNC(setnpcdisplay)
else
size = -1;
- if( class_ != -1 && nd->class_ == class_ )
+ if( class_ != -1 && nd->class_ != class_ )
npc_setclass(nd, class_);
else if( size != -1 )
{ // Required to update the visual size