diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map/atcommand.c | 1 | ||||
-rw-r--r-- | src/map/charcommand.c | 1 | ||||
-rw-r--r-- | src/map/clif.c | 11 | ||||
-rw-r--r-- | src/map/pc.c | 3 | ||||
-rw-r--r-- | src/map/pet.c | 22 | ||||
-rw-r--r-- | src/map/skill.c | 1 | ||||
-rw-r--r-- | src/map/status.c | 2 |
7 files changed, 28 insertions, 13 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 9d4bbe155..8cde99aa2 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -6,6 +6,7 @@ #include <string.h>
#include <ctype.h>
#include <math.h>
+#include <limits.h>
#include "../common/socket.h"
#include "../common/timer.h"
diff --git a/src/map/charcommand.c b/src/map/charcommand.c index 27e92029a..940e51876 100644 --- a/src/map/charcommand.c +++ b/src/map/charcommand.c @@ -6,6 +6,7 @@ #include <string.h>
#include <ctype.h>
#include <math.h>
+#include <limits.h>
#include "../common/socket.h"
#include "../common/timer.h"
diff --git a/src/map/clif.c b/src/map/clif.c index 1e7f6baa9..45142ae29 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9,6 +9,7 @@ #include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <limits.h>
#ifdef __WIN32
#define __USE_W32_SOCKETS
#include <windows.h>
@@ -6863,7 +6864,11 @@ int clif_catch_process(struct map_session_data *sd) WFIFOHEAD(fd,packet_len_table[0x19e]);
WFIFOW(fd,0)=0x19e;
WFIFOSET(fd,packet_len_table[0x19e]);
-
+ sd->menuskill_id = SA_TAMINGMONSTER;
+ if (sd->ud.skillid == SA_TAMINGMONSTER)
+ sd->menuskill_lv = 0; //Free catch
+ else
+ sd->menuskill_lv = sd->itemid; //Consume catch
return 0;
}
@@ -6915,7 +6920,7 @@ int clif_sendegg(struct map_session_data *sd) WFIFOSET(fd,WFIFOW(fd,2));
sd->menuskill_id = SA_TAMINGMONSTER;
- sd->menuskill_lv = n;
+ sd->menuskill_lv = -1;
return 0;
}
@@ -10955,7 +10960,7 @@ void clif_parse_CatchPet(int fd, struct map_session_data *sd) { void clif_parse_SelectEgg(int fd, struct map_session_data *sd) {
RFIFOHEAD(fd);
- if (sd->menuskill_id != SA_TAMINGMONSTER)
+ if (sd->menuskill_id != SA_TAMINGMONSTER || sd->menuskill_lv != -1)
return;
pet_select_egg(sd,RFIFOW(fd,2)-2);
sd->menuskill_lv = sd->menuskill_id = 0;
diff --git a/src/map/pc.c b/src/map/pc.c index 95aab502f..f51d86ecc 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1474,7 +1474,8 @@ int pc_bonus(struct map_session_data *sd,int type,int val) case SP_INFINITE_ENDURE:
if(sd->state.lr_flag != 2) {
sd->special_state.infinite_endure = 1;
- sc_start(&sd->bl, SC_ENDURE,100,1,0);
+ if (sd->sc.data[SC_ENDURE].timer == -1)
+ sc_start(&sd->bl, SC_ENDURE,100,1,0);
}
break;
case SP_INTRAVISION: // Maya Purple Card effect allowing to see Hiding/Cloaking people [DracoRPG]
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);
}
diff --git a/src/map/skill.c b/src/map/skill.c index 3d8aa3544..992ed9ea1 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4616,6 +4616,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in || i==SC_CP_WEAPON || i==SC_CP_SHIELD || i==SC_CP_ARMOR || i==SC_CP_HELM
|| i==SC_COMBO || i==SC_DANCING || i==SC_GUILDAURA || i==SC_EDP
|| i==SC_AUTOBERSERK || i==SC_CARTBOOST || i==SC_MELTDOWN || i==SC_MOONLIT
+ || i==SC_SAFETYWALL
)
continue;
if(i==SC_BERSERK) tsc->data[i].val4=1; //Mark a dispelled berserk to avoid setting hp to 100.
diff --git a/src/map/status.c b/src/map/status.c index 48534e67b..172287bce 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -5191,7 +5191,7 @@ int status_change_timer(int tid, unsigned int tick, int id, int data) if(sc->data[type].timer != tid) {
if(battle_config.error_log)
- ShowError("status_change_timer: Mismatch for type %d: %d != %d\n",type,tid,sc->data[type].timer);
+ ShowError("status_change_timer: Mismatch for type %d: %d != %d (bl id %d)\n",type,tid,sc->data[type].timer, bl->id);
return 0;
}
|