From 50e31d2860fe8f754d186a35ac1b4b61f653af5a Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 27 Mar 2006 14:54:40 +0000 Subject: - Pet catching now uses the menuskill variables to prevent item usage from disrupting the catch process. - Added Safetywall to the list not blocked by Dispell. - Added some include limits.h required by window compiles. - Corrected Wedding rings being trade-able. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5772 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/pet.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/map/pet.c') diff --git a/src/map/pet.c b/src/map/pet.c index ed7309808..1a8e2d557 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -591,20 +591,26 @@ int pet_catch_process2(struct map_session_data *sd,int target_id) return 1; } - if (sd->itemid > 0) + if (sd->menuskill_id != SA_TAMINGMONSTER) + { //Exploit? + clif_pet_rulet(sd,0); + sd->catch_target_class = -1; + return 1; + } + + if (sd->menuskill_lv > 0) { //Consume the pet lure [Skotlex] - if ((i = sd->itemindex) == -1 || - sd->status.inventory[i].nameid != sd->itemid || - !sd->inventory_data[i]->flag.delay_consume || - sd->status.inventory[i].amount < 1 - ) - { //Something went wrong, items moved or they tried an exploit. + i=pc_search_inventory(sd,sd->menuskill_lv); + if (i < 0) + { //they tried an exploit? clif_pet_rulet(sd,0); sd->catch_target_class = -1; return 1; } //Delete the item - sd->itemid = sd->itemindex = -1; + if (sd->itemid == sd->menuskill_lv) + sd->itemid = sd->itemindex = -1; + sd->menuskill_id = sd->menuskill_lv = 0; pc_delitem(sd,i,1,0); } -- cgit v1.2.3-60-g2f50