summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-11 20:02:42 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-11 20:02:42 +0000
commit8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5 (patch)
treea612370540a4dc74521288209c018b722f4e63f6 /src/map/script.c
parent983e4606a13576385556437b5b6b9fc1273f1417 (diff)
downloadhercules-8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5.tar.gz
hercules-8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5.tar.bz2
hercules-8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5.tar.xz
hercules-8f8e2e42ba3ea1416b80190a3006c061ef4ed8b5.zip
- @storage/@gstorage will no longer work if you have a trade or a storage opened already.
- Cleaned up a bit @gstorage - Added a bunch of npc functions required to properly handle moving the NPC cells when an npc is moved from it's previous location. - Added npc_setcells to handle setting down the NPC cells of ontouch npcs. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9990 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/map/script.c b/src/map/script.c
index eb1bc4609..9b15497bc 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10895,7 +10895,6 @@ BUILDIN_FUNC(movenpc)
TBL_NPC *nd = NULL;
const char *npc;
int x,y;
- short m;
npc = conv_str(st,& (st->stack->stack_data[st->start+2]));
x = conv_num(st,& (st->stack->stack_data[st->start+3]));
@@ -10904,17 +10903,7 @@ BUILDIN_FUNC(movenpc)
if ((nd = npc_name2id(npc)) == NULL)
return -1;
- if ((m=nd->bl.m) < 0 || nd->bl.prev == NULL)
- return -1; //Not on a map.
-
- if (x < 0) x = 0;
- else if (x >= map[m].xs) x = map[m].xs-1;
- if (y < 0) y = 0;
- else if (y >= map[m].ys) y = map[m].ys-1;
- map_foreachinrange(clif_outsight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
- map_moveblock(&nd->bl, x, y, gettick());
- map_foreachinrange(clif_insight, &nd->bl, AREA_SIZE, BL_PC, &nd->bl);
-
+ npc_movenpc(nd, x, y);
return 0;
}