diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-10 19:29:10 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-02-10 19:29:10 +0000 |
commit | 82e545c3bd291ce061199e3a8d0685bf981ca8b6 (patch) | |
tree | a214829205a8037f662466d92689be1a57a768e2 /src | |
parent | cc01193a8ae7de206290129eb1bbf3296a28d1bf (diff) | |
download | hercules-82e545c3bd291ce061199e3a8d0685bf981ca8b6.tar.gz hercules-82e545c3bd291ce061199e3a8d0685bf981ca8b6.tar.bz2 hercules-82e545c3bd291ce061199e3a8d0685bf981ca8b6.tar.xz hercules-82e545c3bd291ce061199e3a8d0685bf981ca8b6.zip |
- Lures won't be lost now when you use them on a non-mob.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5252 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/pet.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/pet.c b/src/map/pet.c index f94154fe4..28f5898f8 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -1087,6 +1087,14 @@ int pet_catch_process2(struct map_session_data *sd,int target_id) nullpo_retr(1, sd);
+ md=(struct mob_data*)map_id2bl(target_id);
+ if(!md || md->bl.type != BL_MOB || md->bl.prev == NULL){
+ //Abort capture.
+ sd->catch_target_class = -1;
+ sd->itemid = sd->itemindex = -1;
+ return 1;
+ }
+
if (sd->itemid > 0)
{ //Consume the pet lure [Skotlex]
if ((i = sd->itemindex) == -1 ||
@@ -1103,13 +1111,6 @@ int pet_catch_process2(struct map_session_data *sd,int target_id) sd->itemid = sd->itemindex = -1;
pc_delitem(sd,i,1,0);
}
-
- md=(struct mob_data*)map_id2bl(target_id);
- if(!md || md->bl.type != BL_MOB || md->bl.prev == NULL){
- clif_pet_rulet(sd,0);
- sd->catch_target_class = -1;
- return 1;
- }
i = search_petDB_index(md->class_,PET_CLASS);
//catch_target_class == 0 is used for universal lures. [Skotlex]
|