Map server crash fixes

- Fixed two parts of the code that could lead to a map server crash
This commit is contained in:
Playtester 2014-10-22 21:23:38 +02:00
parent 8b755e5419
commit 41ec18eae7
2 changed files with 8 additions and 3 deletions

View File

@ -7082,7 +7082,7 @@ struct block_list* battle_get_master(struct block_list *src)
*
* Credits:
* Original coder unknown
* Rewritten by Skoltex
* Rewritten by Skotlex
*/
int battle_check_target( struct block_list *src, struct block_list *target,int flag)
{
@ -7252,7 +7252,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
case BL_SKILL: {
struct skill_unit *su = (struct skill_unit *)src;
if (su && su->group && su->group->src_id == target->id) {
if (!su || !su->group)
return 0;
if (su->group->src_id == target->id) {
int inf2 = skill_get_inf2(su->group->skill_id);
if (inf2&INF2_NO_TARGET_SELF)
return -1;

View File

@ -6701,7 +6701,9 @@ int status_get_party_id(struct block_list *bl)
return ((TBL_MER*)bl)->master->status.party_id;
break;
case BL_SKILL:
return ((TBL_SKILL*)bl)->group->party_id;
if (((TBL_SKILL*)bl)->group)
return ((TBL_SKILL*)bl)->group->party_id;
break;
case BL_ELEM:
if (((TBL_ELEM*)bl)->master)
return ((TBL_ELEM*)bl)->master->status.party_id;