Follow up r16445 performance improvement.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16446 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
1c121768cb
commit
8be88c67b2
@ -4801,35 +4801,18 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
|
|||||||
if( (s_bl = battle_get_master(src)) == NULL )
|
if( (s_bl = battle_get_master(src)) == NULL )
|
||||||
s_bl = src;
|
s_bl = src;
|
||||||
|
|
||||||
// Disable PVM for specific groups.
|
if ( s_bl->type == BL_PC ) {
|
||||||
if (src->type&BL_PC && target->type&BL_MOB && src->id && map_id2sd(src->id) != NULL)
|
switch( t_bl->type ) {
|
||||||
{ // Source => PC, Target => MOB
|
case BL_MOB: // Source => PC, Target => MOB
|
||||||
if (pc_has_permission(map_id2sd(src->id), PC_PERM_DISABLE_PVM))
|
if ( pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVM) )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
break;
|
||||||
else if (src->type&BL_HOM && target->type&BL_MOB)
|
case BL_PC:
|
||||||
{ // Source => HOM, Target => MOB; check the master BL id of homun
|
if (pc_has_permission((TBL_PC*)s_bl, PC_PERM_DISABLE_PVP))
|
||||||
struct homun_data *hd = (TBL_HOM*)src;
|
|
||||||
if (hd != NULL && hd->master->bl.id)
|
|
||||||
{
|
|
||||||
if (pc_has_permission(map_id2sd(hd->master->bl.id), PC_PERM_DISABLE_PVM))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disable PVP
|
|
||||||
if (src->type&BL_PC && target->type&(BL_PC|BL_HOM) && src->id && map_id2sd(src->id) != NULL)
|
|
||||||
{ // Source => PC, Target => PC
|
|
||||||
if (pc_has_permission(map_id2sd(src->id), PC_PERM_DISABLE_PVP))
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if (src->type&BL_HOM && target->type&(BL_HOM|BL_PC))
|
|
||||||
{ // Source => HOM, Target => MOB|PC; check the master BL id of homun
|
|
||||||
struct homun_data *hd = (TBL_HOM*)src;
|
|
||||||
if (hd != NULL && hd->master->bl.id)
|
|
||||||
{
|
|
||||||
if (pc_has_permission(map_id2sd(hd->master->bl.id), PC_PERM_DISABLE_PVP))
|
|
||||||
return 0;
|
return 0;
|
||||||
|
break;
|
||||||
|
default:/* anything else goes */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user