summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-30 08:25:03 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-30 08:25:03 +0000
commit1a71202b477c6820b9193a1131a61c3c7b005924 (patch)
tree517c5a841b0dd02c120d8fa20a268a147a11425b /src/map
parent97cb8eebed531dda76a2f4015a95823a9540dd0a (diff)
downloadhercules-1a71202b477c6820b9193a1131a61c3c7b005924.tar.gz
hercules-1a71202b477c6820b9193a1131a61c3c7b005924.tar.bz2
hercules-1a71202b477c6820b9193a1131a61c3c7b005924.tar.xz
hercules-1a71202b477c6820b9193a1131a61c3c7b005924.zip
* Added a define for star gladiator feel/hate info array length (follow up to r8721 and r11840).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14523 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c4
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/mob.c4
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/pc.h3
5 files changed, 10 insertions, 9 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index c810d4092..4feb6d4ce 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -1942,8 +1942,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo
if (sc && sc->data[SC_MIRACLE]) i = 2; //Star anger
else
- ARR_FIND(0, 3, i, t_class == sd->hate_mob[i]);
- if (i < 3 && (skill=pc_checkskill(sd,sg_info[i].anger_id)))
+ ARR_FIND(0, MAX_PC_FEELHATE, i, t_class == sd->hate_mob[i]);
+ if (i < MAX_PC_FEELHATE && (skill=pc_checkskill(sd,sg_info[i].anger_id)))
{
skillratio = sd->status.base_level + sstatus->dex + sstatus->luk;
if (i == 2) skillratio += sstatus->str; //Star Anger
diff --git a/src/map/clif.c b/src/map/clif.c
index 51706f431..ee4e20d79 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -12260,7 +12260,7 @@ void clif_parse_FeelSaveOk(int fd,struct map_session_data *sd)
if (sd->menuskill_id != SG_FEEL)
return;
i = sd->menuskill_val-1;
- if (i<0 || i > 2) return; //Bug?
+ if (i<0 || i >= MAX_PC_FEELHATE) return; //Bug?
sd->feel_map[i].index = map_id2index(sd->bl.m);
sd->feel_map[i].m = sd->bl.m;
diff --git a/src/map/mob.c b/src/map/mob.c
index edea51008..d6516dcec 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2064,9 +2064,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
temp = status_get_class(&md->bl);
if(sd->sc.data[SC_MIRACLE]) i = 2; //All mobs are Star Targets
else
- ARR_FIND(0, 3, i, temp == sd->hate_mob[i] &&
+ ARR_FIND(0, MAX_PC_FEELHATE, i, temp == sd->hate_mob[i] &&
(battle_config.allow_skill_without_day || sg_info[i].day_func()));
- if(i<3 && (temp=pc_checkskill(sd,sg_info[i].bless_id)))
+ if(i<MAX_PC_FEELHATE && (temp=pc_checkskill(sd,sg_info[i].bless_id)))
bonus += (i==2?20:10)*temp;
}
if(battle_config.mobs_level_up && md->level > md->db->lv) // [Valaris]
diff --git a/src/map/pc.c b/src/map/pc.c
index bb0eee4bf..37882908a 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -67,7 +67,7 @@ struct duel duel_list[MAX_DUEL];
int duel_count = 0;
//Links related info to the sd->hate_mob[]/sd->feel_map[] entries
-const struct sg_data sg_info[3] = {
+const struct sg_data sg_info[MAX_PC_FEELHATE] = {
{ SG_SUN_ANGER, SG_SUN_BLESS, SG_SUN_COMFORT, "PC_FEEL_SUN", "PC_HATE_MOB_SUN", is_day_of_sun },
{ SG_MOON_ANGER, SG_MOON_BLESS, SG_MOON_COMFORT, "PC_FEEL_MOON", "PC_HATE_MOB_MOON", is_day_of_moon },
{ SG_STAR_ANGER, SG_STAR_BLESS, SG_STAR_COMFORT, "PC_FEEL_STAR", "PC_HATE_MOB_STAR", is_day_of_star }
@@ -1030,7 +1030,7 @@ int pc_reg_received(struct map_session_data *sd)
}
//SG map and mob read [Komurka]
- for(i=0;i<3;i++) //for now - someone need to make reading from txt/sql
+ for(i=0;i<MAX_PC_FEELHATE;i++) //for now - someone need to make reading from txt/sql
{
if ((j = pc_readglobalreg(sd,sg_info[i].feel_var))!=0) {
sd->feel_map[i].index = j;
@@ -5460,7 +5460,7 @@ int pc_resetfeel(struct map_session_data* sd)
int i;
nullpo_ret(sd);
- for (i=0; i<3; i++)
+ for (i=0; i<MAX_PC_FEELHATE; i++)
{
sd->feel_map[i].m = -1;
sd->feel_map[i].index = 0;
diff --git a/src/map/pc.h b/src/map/pc.h
index 359b9ca90..5dbff7e23 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -17,6 +17,7 @@
#include "mob.h"
#define MAX_PC_BONUS 10
+#define MAX_PC_FEELHATE 3
struct weapon_data {
int atkmods[3];
@@ -733,7 +734,7 @@ struct sg_data {
char hate_var[NAME_LENGTH];
int (*day_func)(void);
};
-extern const struct sg_data sg_info[3];
+extern const struct sg_data sg_info[MAX_PC_FEELHATE];
void pc_setinvincibletimer(struct map_session_data* sd, int val);
void pc_delinvincibletimer(struct map_session_data* sd);