summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-27 14:54:40 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-27 14:54:40 +0000
commit50e31d2860fe8f754d186a35ac1b4b61f653af5a (patch)
tree2ddbbc4bc094e98daca48f38b5130beb320d50cb /src/map/pet.c
parent7e54a062e03f14bb1540f6b4ff249cf888d5ea35 (diff)
downloadhercules-50e31d2860fe8f754d186a35ac1b4b61f653af5a.tar.gz
hercules-50e31d2860fe8f754d186a35ac1b4b61f653af5a.tar.bz2
hercules-50e31d2860fe8f754d186a35ac1b4b61f653af5a.tar.xz
hercules-50e31d2860fe8f754d186a35ac1b4b61f653af5a.zip
- 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
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c22
1 files changed, 14 insertions, 8 deletions
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);
}