Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (2)No (0)
Photo

Map Server Crash on Clone

Posted by Mhalicot on 22 June 2014 - 03:43 PM

Issue:
Similar with this. Map Server Crash

How to Reproduce:
Create a new character named Test

@job 4045
@joblvlup 99
@allskills

Then, type this
@clone Test
@evilclone Test

They will vs each other. Create 1 clone/evilclone and wait. Map server will crash.

the problem is here
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;
	}

md->target_id = tbl->id;

unable to read *tbl

changed severity to: 2 - Fair
changed status to: Confirmed

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

this is how to fix
I hope this fixed

change :
tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size);
md->target_id = tbl->id;
md->min_chase = md->db->range3;
to
if (tbl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), search_size)){
md->target_id = tbl->id;
md->min_chase = md->db->range3;
}

Edited by Kichi, 02 July 2014 - 04:41 AM.


This was already fixed some time ago in https://github.com/H...a96b528ee4aa461
Thank you for reporting and for the feedback

pan 
changed status to: Fixed