summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-09-27 18:49:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-09-27 18:49:48 +0300
commit9d55200e778ab9c98f051948083e4d7a4034a015 (patch)
treef78117badf9e7b6e10222d2872acde7e487850df
parent2b4cd428adf9ca821776e101278a4afb26dd2b66 (diff)
downloadevol-hercules-9d55200e778ab9c98f051948083e4d7a4034a015.tar.gz
evol-hercules-9d55200e778ab9c98f051948083e4d7a4034a015.tar.bz2
evol-hercules-9d55200e778ab9c98f051948083e4d7a4034a015.tar.xz
evol-hercules-9d55200e778ab9c98f051948083e4d7a4034a015.zip
Allow setnpcsex works only with two parameters.
-rw-r--r--src/emap/init.c2
-rw-r--r--src/emap/script.c20
2 files changed, 1 insertions, 21 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 624a7b8..17b1841 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -104,7 +104,7 @@ HPExport void plugin_init (void)
addScriptCommand("addmapmask", "si", addMapMask);
addScriptCommand("removemapmask", "si", removeMapMask);
addScriptCommand("getmapmask", "s", getMapMask);
- addScriptCommand("setnpcsex", "*", setNpcSex);
+ addScriptCommand("setnpcsex", "si", setNpcSex);
addScriptCommand("showavatar", "*", showAvatar);
addScriptCommand("setavatardir", "i", setAvatarDir);
addScriptCommand("setavataraction", "i", setAvatarAction);
diff --git a/src/emap/script.c b/src/emap/script.c
index 56c22b8..39b3d87 100644
--- a/src/emap/script.c
+++ b/src/emap/script.c
@@ -916,26 +916,6 @@ BUILDIN(setNpcSex)
nd = npc->name2id (script_getstr(st, 2));
sex = script_getnum(st, 3);
}
- else if (script_hasdata(st, 2))
- {
- sex = script_getnum(st, 2);
- }
- else
- {
- ShowWarning("no parameters provided\n");
- script->reportsrc(st);
- return false;
- }
-
- if (!nd && !st->oid)
- {
- ShowWarning("npc not found\n");
- script->reportsrc(st);
- return false;
- }
-
- if (!nd)
- nd = (TBL_NPC *) map->id2bl(st->oid);
if (!nd || !nd->vd)
{