diff options
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 60d6ae749..f07e34b2a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1248,50 +1248,50 @@ int pc_bonus(struct map_session_data *sd,int type,int val) case SP_DEF1:
if(sd->state.lr_flag != 2) {
bonus = status->def + val;
- status->def = cap_value(bonus, 0, UCHAR_MAX);
+ status->def = cap_value(bonus, CHAR_MIN, CHAR_MAX);
}
break;
case SP_DEF2:
if(sd->state.lr_flag != 2) {
bonus = status->def2 + val;
- status->def2 = cap_value(bonus, 0, USHRT_MAX);
+ status->def2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_MDEF1:
if(sd->state.lr_flag != 2) {
bonus = status->mdef + val;
- status->mdef = cap_value(bonus, 0, UCHAR_MAX);
+ status->mdef = cap_value(bonus, CHAR_MIN, CHAR_MAX);
}
break;
case SP_MDEF2:
if(sd->state.lr_flag != 2) {
bonus = status->mdef2 + val;
- status->mdef2 = cap_value(bonus, 0, USHRT_MAX);
+ status->mdef2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_HIT:
if(sd->state.lr_flag != 2) {
bonus = status->hit + val;
- status->hit = cap_value(bonus, 0, USHRT_MAX);
+ status->hit = cap_value(bonus, SHRT_MIN, SHRT_MAX);
} else
sd->arrow_hit+=val;
break;
case SP_FLEE1:
if(sd->state.lr_flag != 2) {
bonus = status->flee + val;
- status->flee = cap_value(bonus, 0, USHRT_MAX);
+ status->flee = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_FLEE2:
if(sd->state.lr_flag != 2) {
bonus = status->flee2 + val*10;
- status->flee2 = cap_value(bonus, 0, USHRT_MAX);
+ status->flee2 = cap_value(bonus, SHRT_MIN, SHRT_MAX);
}
break;
case SP_CRITICAL:
if(sd->state.lr_flag != 2) {
bonus = status->cri + val*10;
- status->cri = cap_value(bonus, 0, USHRT_MAX);
+ status->cri = cap_value(bonus, SHRT_MIN, SHRT_MAX);
} else
sd->arrow_cri += val*10;
break;
|