- Cleaned up the pet_ai_hard_lootsearch function to avoid doing map_id2sd calls.
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5910 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
add318fc2f
commit
7aa1324af3
@ -1091,20 +1091,19 @@ int pet_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
|
||||
{
|
||||
struct pet_data* pd;
|
||||
struct flooritem_data *fitem = (struct flooritem_data *)bl;
|
||||
struct map_session_data *sd = NULL;
|
||||
int sd_id =0;
|
||||
int *itc;
|
||||
|
||||
pd=va_arg(ap,struct pet_data *);
|
||||
itc=va_arg(ap,int *);
|
||||
|
||||
// ルート権無し
|
||||
if(fitem && fitem->first_get_id)
|
||||
sd = map_id2sd(fitem->first_get_id);
|
||||
sd_id = fitem->first_get_id;
|
||||
// Removed [Valaris]
|
||||
//if((pd->lootitem_weight + (itemdb_search(fitem->item_data.))->weight * fitem->item_data.amount) > battle_config.pet_weight)
|
||||
// return 0;
|
||||
|
||||
if(pd->loot == NULL || pd->loot->item == NULL || (pd->loot->count >= pd->loot->max) || (sd && sd->pd != pd))
|
||||
if(pd->loot == NULL || pd->loot->item == NULL || (pd->loot->count >= pd->loot->max) ||
|
||||
(sd_id && pd->msd && pd->msd->bl.id != sd_id))
|
||||
return 0;
|
||||
if(bl->m == pd->bl.m && check_distance_bl(&pd->bl, bl, pd->db->range2) &&
|
||||
unit_can_reach(&pd->bl,bl->x,bl->y) && rand()%1000<1000/(++(*itc)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user