From f41e10d3301d186f5075168c7d5503b588f7ba33 Mon Sep 17 00:00:00 2001 From: ai4rei Date: Thu, 21 Apr 2011 15:58:13 +0000 Subject: * Extended debugging code for bugreport:3504 (related r14599). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14801 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog-Trunk.txt | 2 ++ src/map/pc.h | 4 ++++ src/map/status.c | 25 ++++++++++++++++++++++--- src/map/status.h | 3 ++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 366025bef..4b7f17a39 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -1,5 +1,7 @@ Date Added +2011/04/21 + * Extended debugging code for bugreport:3504 (related r14599). [Ai4rei] 2011/04/20 * Fixed quest_check checking exactly 3 quest objectives instead of MAX_QUEST_OBJECTIVES (since r13959). [Gepard] 2011/04/17 diff --git a/src/map/pc.h b/src/map/pc.h index 9ed474b13..0473df3a9 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -421,6 +421,10 @@ struct map_session_data { unsigned int bg_id; unsigned short user_font; + + // temporary debugging of bug #3504 + const char* delunit_prevfile; + int delunit_prevline; }; //Update this max as necessary. 55 is the value needed for Super Baby currently diff --git a/src/map/status.c b/src/map/status.c index e4f333753..e68ebd291 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6429,7 +6429,7 @@ int status_change_clear(struct block_list* bl, int type) /*========================================== * ステータス異常終了 *------------------------------------------*/ -int status_change_end(struct block_list* bl, enum sc_type type, int tid) +int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) { struct map_session_data *sd; struct status_change *sc; @@ -6588,10 +6588,27 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) break; case SC_DANCING: { + const char* prevfile = ""; + int prevline = 0; struct map_session_data *dsd; struct status_change_entry *dsc; struct skill_unit_group *group; + if( sd ) + { + if( sd->delunit_prevfile ) + {// initially this is NULL, when a character logs in + prevfile = sd->delunit_prevfile; + prevline = sd->delunit_prevline; + } + else + { + prevfile = ""; + } + sd->delunit_prevfile = file; + sd->delunit_prevline = line; + } + if(sce->val4 && sce->val4 != BCT_SELF && (dsd=map_id2sd(sce->val4))) {// end status on partner as well dsc = dsd->sc.data[SC_DANCING]; @@ -6608,10 +6625,12 @@ int status_change_end(struct block_list* bl, enum sc_type type, int tid) if( group == NULL ) { - ShowDebug("status_change_end: SC_DANCING is missing skill unit group (val1=%d, val2=%d, val3=%d, val4=%d, timer=%d, tid=%d, char_id=%d, map=%s, x=%d, y=%d). Please report this! (#3504)\n", + ShowDebug("status_change_end: SC_DANCING is missing skill unit group (val1=%d, val2=%d, val3=%d, val4=%d, timer=%d, tid=%d, char_id=%d, map=%s, x=%d, y=%d, prev=%s:%d, from=%s:%d). Please report this! (#3504)\n", sce->val1, sce->val2, sce->val3, sce->val4, sce->timer, tid, sd ? sd->status.char_id : 0, - mapindex_id2name(map_id2index(bl->m)), bl->x, bl->y); + mapindex_id2name(map_id2index(bl->m)), bl->x, bl->y, + prevfile, prevline, + file, line); } sce->val2 = 0; diff --git a/src/map/status.h b/src/map/status.h index 718fd2e88..45eaa5c8d 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1276,7 +1276,8 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti #define sc_start4(bl, type, rate, val1, val2, val3, val4, tick) status_change_start(bl,type,100*(rate),val1,val2,val3,val4,tick,0) int status_change_start(struct block_list* bl,enum sc_type type,int rate,int val1,int val2,int val3,int val4,int tick,int flag); -int status_change_end(struct block_list* bl, enum sc_type type, int tid); +int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line); +#define status_change_end(bl,type,tid) status_change_end_(bl,type,tid,__FILE__,__LINE__) int kaahi_heal_timer(int tid, unsigned int tick, int id, intptr data); int status_change_timer(int tid, unsigned int tick, int id, intptr data); int status_change_timer_sub(struct block_list* bl, va_list ap); -- cgit v1.2.3-70-g09d2