summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 21:43:33 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-26 21:43:33 +0000
commit9ec5fbe2735ffb4ad524f7f5c2c798872106b0aa (patch)
tree32ad5e36536a3019cfc55fb3d099f2f159a1f8c7
parentc14814b628fb14c7266310328969a745dd08d042 (diff)
downloadhercules-9ec5fbe2735ffb4ad524f7f5c2c798872106b0aa.tar.gz
hercules-9ec5fbe2735ffb4ad524f7f5c2c798872106b0aa.tar.bz2
hercules-9ec5fbe2735ffb4ad524f7f5c2c798872106b0aa.tar.xz
hercules-9ec5fbe2735ffb4ad524f7f5c2c798872106b0aa.zip
update
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@795 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt1
-rw-r--r--src/map/battle.c9
-rw-r--r--src/map/clif.c60
3 files changed, 37 insertions, 33 deletions
diff --git a/Changelog.txt b/Changelog.txt
index bffbac0f2..cf874cf69 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,6 @@
Date Added
12/26
+ * Fixed some array bounds errors (SVN 795) [MouseJstr]
* @mapexit (and do_final) now persist all data to the
char server before exiting to eliminate storage/inventory
inconsistancies.. [MouseJstr] (SVN 793)
diff --git a/src/map/battle.c b/src/map/battle.c
index 1dd13b67b..a5f33a655 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -546,7 +546,8 @@ int battle_get_baseatk(struct block_list *bl)
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_PC && (struct map_session_data *)bl) {
batk = ((struct map_session_data *)bl)->base_atk; //設定されているbase_atk
- batk += ((struct map_session_data *)bl)->weapon_atk[((struct map_session_data *)bl)->status.weapon];
+ if (((struct map_session_data *)bl)->status.weapon < 16)
+ batk += ((struct map_session_data *)bl)->weapon_atk[((struct map_session_data *)bl)->status.weapon];
} else { //それ以外なら
int str,dstr;
str = battle_get_str(bl); //STR
@@ -3075,8 +3076,10 @@ static struct Damage battle_calc_pc_weapon_attack(
else
damage2 += atkmin_ ;
if(sd->atk_rate != 100 || sd->weapon_atk_rate != 0) {
- damage = (damage * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
- damage2 = (damage2 * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
+ if (((struct map_session_data *)bl)->status.weapon < 16) {
+ damage = (damage * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
+ damage2 = (damage2 * (sd->atk_rate + sd->weapon_atk_rate[sd->status.weapon]))/100;
+ }
}
if(sd->state.arrow_atk) {
diff --git a/src/map/clif.c b/src/map/clif.c
index 386cceb44..14e4db377 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4567,10 +4567,10 @@ int clif_skill_warppoint(struct map_session_data *sd,int skill_num,
fd=sd->fd;
WFIFOW(fd,0)=0x11c;
WFIFOW(fd,2)=skill_num;
- memcpy(WFIFOP(fd, 4),map1,16);
- memcpy(WFIFOP(fd,20),map2,16);
- memcpy(WFIFOP(fd,36),map3,16);
- memcpy(WFIFOP(fd,52),map4,16);
+ strncpy(WFIFOP(fd, 4),map1,16);
+ strncpy(WFIFOP(fd,20),map2,16);
+ strncpy(WFIFOP(fd,36),map3,16);
+ strncpy(WFIFOP(fd,52),map4,16);
WFIFOSET(fd,packet_len_table[0x11c]);
return 0;
}
@@ -6388,32 +6388,32 @@ int clif_guild_basicinfo(struct map_session_data *sd)
if(g->guild_id == gc->guild_id) t++;
}
- if (t==1) memcpy(WFIFOP(fd,94),"One Castle",20);
- else if (t==2) memcpy(WFIFOP(fd,94),"Two Castles",20);
- else if (t==3) memcpy(WFIFOP(fd,94),"Three Castles",20);
- else if (t==4) memcpy(WFIFOP(fd,94),"Four Castles",20);
- else if (t==5) memcpy(WFIFOP(fd,94),"Five Castles",20);
- else if (t==6) memcpy(WFIFOP(fd,94),"Six Castles",20);
- else if (t==7) memcpy(WFIFOP(fd,94),"Seven Castles",20);
- else if (t==8) memcpy(WFIFOP(fd,94),"Eight Castles",20);
- else if (t==9) memcpy(WFIFOP(fd,94),"Nine Castles",20);
- else if (t==10) memcpy(WFIFOP(fd,94),"Ten Castles",20);
- else if (t==11) memcpy(WFIFOP(fd,94),"Eleven Castles",20);
- else if (t==12) memcpy(WFIFOP(fd,94),"Twelve Castles",20);
- else if (t==13) memcpy(WFIFOP(fd,94),"Thirteen Castles",20);
- else if (t==14) memcpy(WFIFOP(fd,94),"Fourteen Castles",20);
- else if (t==15) memcpy(WFIFOP(fd,94),"Fifteen Castles",20);
- else if (t==16) memcpy(WFIFOP(fd,94),"Sixteen Castles",20);
- else if (t==17) memcpy(WFIFOP(fd,94),"Seventeen Castles",20);
- else if (t==18) memcpy(WFIFOP(fd,94),"Eighteen Castles",20);
- else if (t==19) memcpy(WFIFOP(fd,94),"Nineteen Castles",20);
- else if (t==20) memcpy(WFIFOP(fd,94),"Twenty Castles",20);
- else if (t==21) memcpy(WFIFOP(fd,94),"Twenty One Castles",20);
- else if (t==22) memcpy(WFIFOP(fd,94),"Twenty Two Castles",20);
- else if (t==23) memcpy(WFIFOP(fd,94),"Twenty Three Castles",20);
- else if (t==24) memcpy(WFIFOP(fd,94),"Twenty Four Castles",20);
- else if (t==MAX_GUILDCASTLE) memcpy(WFIFOP(fd,94),"Total Domination",20);
- else memcpy(WFIFOP(fd,94),"None Taken",20);
+ if (t==1) strncpy(WFIFOP(fd,94),"One Castle",20);
+ else if (t==2) strncpy(WFIFOP(fd,94),"Two Castles",20);
+ else if (t==3) strncpy(WFIFOP(fd,94),"Three Castles",20);
+ else if (t==4) strncpy(WFIFOP(fd,94),"Four Castles",20);
+ else if (t==5) strncpy(WFIFOP(fd,94),"Five Castles",20);
+ else if (t==6) strncpy(WFIFOP(fd,94),"Six Castles",20);
+ else if (t==7) strncpy(WFIFOP(fd,94),"Seven Castles",20);
+ else if (t==8) strncpy(WFIFOP(fd,94),"Eight Castles",20);
+ else if (t==9) strncpy(WFIFOP(fd,94),"Nine Castles",20);
+ else if (t==10) strncpy(WFIFOP(fd,94),"Ten Castles",20);
+ else if (t==11) strncpy(WFIFOP(fd,94),"Eleven Castles",20);
+ else if (t==12) strncpy(WFIFOP(fd,94),"Twelve Castles",20);
+ else if (t==13) strncpy(WFIFOP(fd,94),"Thirteen Castles",20);
+ else if (t==14) strncpy(WFIFOP(fd,94),"Fourteen Castles",20);
+ else if (t==15) strncpy(WFIFOP(fd,94),"Fifteen Castles",20);
+ else if (t==16) strncpy(WFIFOP(fd,94),"Sixteen Castles",20);
+ else if (t==17) strncpy(WFIFOP(fd,94),"Seventeen Castles",20);
+ else if (t==18) strncpy(WFIFOP(fd,94),"Eighteen Castles",20);
+ else if (t==19) strncpy(WFIFOP(fd,94),"Nineteen Castles",20);
+ else if (t==20) strncpy(WFIFOP(fd,94),"Twenty Castles",20);
+ else if (t==21) strncpy(WFIFOP(fd,94),"Twenty One Castles",20);
+ else if (t==22) strncpy(WFIFOP(fd,94),"Twenty Two Castles",20);
+ else if (t==23) strncpy(WFIFOP(fd,94),"Twenty Three Castles",20);
+ else if (t==24) strncpy(WFIFOP(fd,94),"Twenty Four Castles",20);
+ else if (t==MAX_GUILDCASTLE) strncpy(WFIFOP(fd,94),"Total Domination",20);
+ else strncpy(WFIFOP(fd,94),"None Taken",20);
WFIFOSET(fd,packet_len_table[WFIFOW(fd,0)]);
clif_guild_emblem(sd,g); // Guild emblem vanish fix [Valaris]