summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/pc.c7
-rw-r--r--src/map/status.c15
3 files changed, 19 insertions, 5 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 0faa040ef..8da0f1265 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -5182,7 +5182,7 @@ int atcommand_disguise(const int fd, struct map_session_data* sd, const char* co
*------------------------------------------*/
int atcommand_disguiseall(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
- int mob_id=0, i=0;
+ int mob_id=0;
struct map_session_data *pl_sd;
struct s_mapiterator* iter;
nullpo_retr(-1, sd);
diff --git a/src/map/pc.c b/src/map/pc.c
index 218e40e24..99fcb0ace 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3087,6 +3087,13 @@ int pc_useitem(struct map_session_data *sd,int n)
))
return 0;
+ //Since most delay-consume items involve using a "skill-type" target cursor,
+ //perform a skill-use check before going through. [Skotlex]
+ //resurrection was picked as testing skill, as a non-offensive, generic skill, it will do.
+ if (sd->inventory_data[n]->flag.delay_consume &&
+ !status_check_skilluse(&sd->bl, &sd->bl, ALL_RESURRECTION, 0))
+ return 0;
+
sd->itemid = sd->status.inventory[n].nameid;
sd->itemindex = n;
if(sd->catch_target_class != -1) //Abort pet catching.
diff --git a/src/map/status.c b/src/map/status.c
index 015ce1ddf..d4836919f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1226,7 +1226,7 @@ int status_base_amotion_pc(struct map_session_data* sd, struct status_data* stat
return amotion;
}
-static int status_base_atk(struct block_list *bl, struct status_data *status)
+static unsigned short status_base_atk(struct block_list *bl, struct status_data *status)
{
int flag = 0, str, dex, dstr;
@@ -1259,7 +1259,7 @@ static int status_base_atk(struct block_list *bl, struct status_data *status)
str += dstr*dstr;
if (bl->type == BL_PC)
str+= dex/5 + status->luk/5;
- return str;
+ return cap_value(str, 0, USHRT_MAX);
}
#define status_base_matk_max(status) (status->int_+(status->int_/5)*(status->int_/5))
@@ -1293,7 +1293,11 @@ void status_calc_misc(struct block_list *bl, struct status_data *status, int lev
else
status->flee2 = 0;
- status->batk += status_base_atk(bl, status);
+ if (status->batk) {
+ int temp = status->batk + status_base_atk(bl, status);
+ status->batk = cap_value(temp, 0, USHRT_MAX);
+ } else
+ status->batk = status_base_atk(bl, status);
if (status->cri)
switch (bl->type) {
case BL_MOB:
@@ -3004,7 +3008,10 @@ void status_calc_bl(struct block_list *bl, unsigned long flag)
status->batk = status_base_atk(bl,status);
temp = b_status->batk - status_base_atk(bl,b_status);
if (temp)
- status->batk += temp;
+ {
+ temp += status->batk;
+ status->batk = cap_value(temp, 0, USHRT_MAX);
+ }
status->batk = status_calc_batk(bl, sc, status->batk);
}