summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 4cc22f5cb..3164fe950 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -2708,7 +2708,11 @@ int clif_updatestatus(struct map_session_data *sd,int type)
WFIFOL(fd,4)=sd->battle_status.def2;
break;
case SP_MDEF2:
- WFIFOL(fd,4)=sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
+ //negative check (in case you have something like Berserk active)
+ len = sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
+ if (len < 0) len = 0;
+ WFIFOL(fd,4)= len;
+ len = 8;
break;
case SP_CRITICAL:
WFIFOL(fd,4)=sd->battle_status.cri/10;
@@ -3033,7 +3037,10 @@ int clif_initialstatus(struct map_session_data *sd)
WBUFW(buf,24) = sd->battle_status.def; // def
WBUFW(buf,26) = sd->battle_status.def2;
WBUFW(buf,28) = sd->battle_status.mdef; // mdef
- WBUFW(buf,30) = sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
+ fd = sd->battle_status.mdef2 - (sd->battle_status.vit>>1);
+ if (fd < 0) fd = 0; //Negative check for Frenzy'ed characters.
+ WBUFW(buf,30) = fd;
+ fd = sd->fd;
WBUFW(buf,32) = sd->battle_status.hit;
WBUFW(buf,34) = sd->battle_status.flee;
WBUFW(buf,36) = sd->battle_status.flee2/10;