From 5b756ab22876fccebbee146eae41152a9dff700f Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 28 Mar 2006 14:19:51 +0000 Subject: - 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 --- Changelog-Trunk.txt | 3 +++ sql-files/mob_db.sql | 2 +- src/map/map.h | 4 ---- src/map/npc.c | 31 +++++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 6ce4a6d0b..b3851a34e 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -5,6 +5,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS 2006/03/28 + * Added a debug function to locate all "looping warps" (not quite tested + yet) [Skotlex] + * Some cleanup of the skill-use functions in clif.c [Skotlex] * Fixed Gunslinger and Ninja skills not showing up and not working due to an error in skill_require_db - also commited a commented block for GS_FLING that needs to be looked at and posiably diff --git a/sql-files/mob_db.sql b/sql-files/mob_db.sql index f5a2f7708..b4eef70d4 100644 --- a/sql-files/mob_db.sql +++ b/sql-files/mob_db.sql @@ -818,7 +818,7 @@ REPLACE INTO `mob_db` VALUES (1737,'ALIZA','Aliza',69,19000,0,6583,3400,1,750,11 REPLACE INTO `mob_db` VALUES (1738,'CONSTANT','Constant',55,8067,0,3230,116,1,460,580,10,30,1,55,16,30,82,55,10,12,0,0,67,653,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); REPLACE INTO `mob_db` VALUES (1739,'G_ALICEL','Alicel',75,37520,0,0,0,1,950,2470,25,40,1,75,25,46,112,75,10,12,1,0,67,653,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); REPLACE INTO `mob_db` VALUES (1740,'G_ALIOT','Aliot',75,48290,0,0,0,1,1800,2770,45,25,1,75,52,30,112,75,10,12,1,0,67,653,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -REPLACE INTO `mob_db` VALUES (1745,'G_ALIZA','Aliza',69,19000,0,0,0,1,750,1100,25,60,1,69,27,61,103,69,10,12,1,7,60,145,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +REPLACE INTO `mob_db` VALUES (1741,'G_ALIZA','Aliza',69,19000,0,0,0,1,750,1100,25,60,1,69,27,61,103,69,10,12,1,7,60,145,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); REPLACE INTO `mob_db` VALUES (1746,'G_CONSTANT','Constant',55,8067,0,0,0,1,460,580,10,30,1,55,16,30,82,55,10,12,0,0,67,653,200,1872,672,480,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); -- -- //Odin monsters(no stats yet) diff --git a/src/map/map.h b/src/map/map.h index a410870d9..9a75028ef 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -776,10 +776,6 @@ struct npc_data { short flag; unsigned int next_walktime; - struct { // [Valaris] - unsigned state : 8; - } state; - char eventqueue[MAX_EVENTQUEUE][50]; int eventtimer[MAX_EVENTTIMER]; short arenaflag; 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"); -- cgit v1.2.3-70-g09d2