summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-28 14:19:51 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-28 14:19:51 +0000
commit5b756ab22876fccebbee146eae41152a9dff700f (patch)
treeebba87072d53c821ebef149a37796a248cf1fe21 /src/map/npc.c
parentc09e5d1fee813fd746fc0d2b7f9f24b2fc5e7e0d (diff)
downloadhercules-5b756ab22876fccebbee146eae41152a9dff700f.tar.gz
hercules-5b756ab22876fccebbee146eae41152a9dff700f.tar.bz2
hercules-5b756ab22876fccebbee146eae41152a9dff700f.tar.xz
hercules-5b756ab22876fccebbee146eae41152a9dff700f.zip
- Added a debug function to locate all "looping warps"
- Some cleanup of the skill-use functions in clif.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5787 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 0035f6739..4f0877076 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2647,6 +2647,33 @@ int do_final_npc(void)
return 0;
}
+static void npc_debug_warps_sub(struct npc_data *nd)
+{
+ int m;
+ if (nd->bl.type != BL_NPC || nd->bl.subtype != WARP || nd->bl.m < 0)
+ return;
+
+ m = map_mapindex2mapid(nd->u.warp.mapindex);
+ if (m < 0) return; //Warps to another map, nothing to do about it.
+
+ if (!map_getcell(m, nd->u.warp.x, nd->u.warp.y, CELL_CHKNPC))
+ return;
+
+ ShowWarning("Warp %s/%s at %s(%d,%d) warps directly on top of an area npc at %s(%d,%d)\n",
+ nd->name, nd->exname,
+ map[nd->bl.m].name, nd->bl.x, nd->bl.y,
+ map[m].name, nd->u.warp.x, nd->u.warp.y
+ );
+
+}
+static void npc_debug_warps()
+{
+ int m, i;
+ for (m = 0; m < map_num; m++)
+ for (i = 0; i < map[m].npc_num; i++)
+ npc_debug_warps_sub(map[m].npc[i]);
+}
+
/*==========================================
* npcŹ‰Šú‰»
*------------------------------------------
@@ -2701,6 +2728,10 @@ int do_init_npc(void)
CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
npc_id - START_NPC_NUM, "", npc_warp, npc_shop, npc_script, npc_mob, npc_cache_mob, npc_delay_mob);
+
+ //Debug function to locate all endless loop warps.
+ npc_debug_warps();
+
add_timer_func_list(npc_event_timer,"npc_event_timer");
add_timer_func_list(npc_event_do_clock,"npc_event_do_clock");
add_timer_func_list(npc_timerevent,"npc_timerevent");