Issue Information
-
#007721
-
0 - None Assigned
-
Fixed
Issue Confirmations
-
Yes (0)No (0)
lastest update make map crashing on battleground.
- script test -1,{ OnInit: $@team1= bg_create_team("prontera",36,39); $@team2 = bg_create_team("prontera",168,156); end; }
crash at start up
int bg_send_xy_timer(int tid, unsigned int tick, int id, intptr_t data) {
//bg->team_db->foreach(bg->team_db, bg->send_xy_timer_sub, tick); << comment this line out stop mapserver from crashing
return 0;
}
int bg_send_xy_timer_sub(DBKey key, DBData *data, va_list ap)
{
struct battleground_data *bg = DB->data2ptr(data);
struct map_session_data *sd;
int i;
nullpo_ret(bg);
for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
if( (sd = bg->members[i].sd) == NULL )
continue;
if( sd->bl.x != bg->members[i].x || sd->bl.y != bg->members[i].y ) { // xy update
bg->members[i].x = sd->bl.x;
bg->members[i].y = sd->bl.y;
clif->bg_xy(sd);
}
}
return 0;
}
Its seems that bg->members[i].sd is not null and it let the process go, but
sd->bl.x , its empty, bcoz no one's attached, that causes the map to crash.
Edited by Dastgir Pojee, 24 September 2013 - 04:14 AM.
Some null-pointer checks (and possibly other assignments) are no longer in place, since they're still using 'bg', while they should use 'bgd' or whichever variable is applicable to the specific case.
Fix coming soon (but lunch comes first.)