summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 21:14:54 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-01-06 21:14:54 +0000
commit1155148a46f0e1108d46b95a69630061347991cb (patch)
tree5a981b1ddc8294b895b151febf251ef7ceaced01 /src/map
parent0c8a19560039317e3db5c126d0e76a231615b4ac (diff)
downloadhercules-1155148a46f0e1108d46b95a69630061347991cb.tar.gz
hercules-1155148a46f0e1108d46b95a69630061347991cb.tar.bz2
hercules-1155148a46f0e1108d46b95a69630061347991cb.tar.xz
hercules-1155148a46f0e1108d46b95a69630061347991cb.zip
Expanded the poor "npc_touch_areanpc : some bug" with info about which cell exactly caused the problem.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12024 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/npc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 79747dbf3..0f0c09e62 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -710,8 +710,9 @@ int npc_event(struct map_session_data* sd, const char* eventname, int mob_kill)
*------------------------------------------*/
int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
{
- int i,f=1;
int xs,ys;
+ int f = 1;
+ int i;
nullpo_retr(1, sd);
@@ -720,8 +721,8 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
for(i=0;i<map[m].npc_num;i++)
{
- if (map[m].npc[i]->sc.option&OPTION_INVISIBLE) { // 無効化されている
- f=0;
+ if (map[m].npc[i]->sc.option&OPTION_INVISIBLE) {
+ f=0; // a npc was found, but it is disabled; don't print warning
continue;
}
@@ -741,9 +742,10 @@ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y)
&& y >= map[m].npc[i]->bl.y-ys && y <= map[m].npc[i]->bl.y+ys )
break;
}
- if (i==map[m].npc_num) {
- if (f)
- ShowError("npc_touch_areanpc : some bug \n");
+ if( i == map[m].npc_num )
+ {
+ if( f == 1 ) // no npc found
+ ShowError("npc_touch_areanpc : stray NPC cell on coordinates '%s',%d,%d\n", map[m].name, x, y);
return 1;
}
switch(map[m].npc[i]->subtype) {