Issue information

Issue ID
#8237
Status
Fixed
Severity
Fair
Started
Mhalicot
Jun 22, 2014 15:43
Last Post
pan
Jul 2, 2014 7:34
Confirmation
Yes (2)
No (0)

Mhalicot - Jun 22, 2014 15:43

[b]Issue:[/b]
Similar with this. [url="http://herc.ws/board/tracker/issue-8201-map-server-crash/?gopid=22842#entry22842"]Map Server Crash[/url]

[b]How to Reproduce:[/b]
[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]Create a new character named Test[/size][/font][/color]

[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]@job 4045[/size][/font][/color]
[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]@joblvlup 99[/size][/font][/color]
[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]@allskills[/size][/font][/color]

[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]Then, type this[/size][/font][/color]
[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]@clone Test[/size][/font][/color]
[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]@evilclone Test[/size][/font][/color]

[color=rgb(40,40,40)][font=helvetica, arial, sans-serif][size=3]They will vs each other. Create 1 clone/evilclone and wait. Map server will crash.[/size][/font][/color]

This post has been edited by Mhalicot on Jun 22, 2014 15:45

Kichi - Jun 23, 2014 5:50

the problem is here
[code=auto:0] if (battle->check_range (&md->bl, tbl, md->status.rhw.range)) { //Target within range, engage if(tbl->type == BL_PC) mob->log_damage(md, tbl, 0); //Log interaction (counts as 'attacker' for the exp bonus) if(!(mode&MD_RANDOMTARGET)) unit->attack(&md->bl,tbl->id,1); else { // Attack once and find new random target int search_size = (view_range < md->status.rhw.range) ? view_range : md->status.rhw.range; unit->attack(&md->bl,tbl->id,0); tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size); md->target_id = tbl->id; md->min_chase = md->db->range3; } return true; } [/code]

md->target_id = tbl->id;

unable to read *tbl

Kichi - Jun 24, 2014 3:25

i think this is serious problem
if any monster with mode randomtarget can cause this error

Mhalicot - Jun 30, 2014 4:41

Up

Kichi - Jul 2, 2014 4:40

this is how to fix
I hope this fixed

[b]change [/b]:[code=auto:0] tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size); md->target_id = tbl->id; md->min_chase = md->db->range3; [/code]
[b]to[/b][code=auto:0] if (tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size)){ md->target_id = tbl->id; md->min_chase = md->db->range3; } [/code]

This post has been edited by Kichi on Jul 2, 2014 4:41

pan - Jul 2, 2014 7:34

This was already fixed some time ago in [url="https://github.com/HerculesWS/Hercules/commit/aff9c142c8fdfc602b304825ca96b528ee4aa461"]https://github.com/HerculesWS/Hercules/commit/aff9c142c8fdfc602b304825ca96b528ee4aa461[/url]
Thank you for reporting and for the feedback