summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-21 16:20:26 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-21 16:20:26 +0000
commit39253de1b1335b0c9f71d5bc31c1a6b5a95f6940 (patch)
tree44f84d16dc991ab884284292d6f4de9af41937eb /src
parent82e2517fa237679eb08818b0b600a28bb781ad07 (diff)
downloadhercules-39253de1b1335b0c9f71d5bc31c1a6b5a95f6940.tar.gz
hercules-39253de1b1335b0c9f71d5bc31c1a6b5a95f6940.tar.bz2
hercules-39253de1b1335b0c9f71d5bc31c1a6b5a95f6940.tar.xz
hercules-39253de1b1335b0c9f71d5bc31c1a6b5a95f6940.zip
* Added enumeration RC2_* for mob data 'race2' (bugreport:4561).
- Fixed race2-related bonus arrays using RC_MAX, rather than race2 maximum (since r6221, related r1277). - Fixed bSubRace2 lacking bounds check (since r1257). - Fixed bSubRace2 being documented as bSPSubRace2 (since r1257). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14480 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.h11
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/mob.h1
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/pc.h4
5 files changed, 17 insertions, 6 deletions
diff --git a/src/map/map.h b/src/map/map.h
index 199db618d..9f25249e2 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -211,6 +211,17 @@ enum {
};
enum {
+ RC2_NONE = 0,
+ RC2_GOBLIN,
+ RC2_KOBOLD,
+ RC2_ORC,
+ RC2_GOLEM,
+ RC2_GUARDIAN,
+ RC2_NINJA,
+ RC2_MAX
+};
+
+enum {
ELE_NEUTRAL=0,
ELE_WATER,
ELE_EARTH,
diff --git a/src/map/mob.c b/src/map/mob.c
index 81fc9e68b..413d88f26 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4349,7 +4349,7 @@ static int mob_readdb_race(void)
continue;
race=atoi(str[0]);
- if (race < 0 || race >= MAX_MOB_RACE_DB)
+ if (race < RC2_NONE || race >= RC2_MAX)
continue;
for (j=1; j<20; j++) {
diff --git a/src/map/mob.h b/src/map/mob.h
index b0efdbfb4..e8bd0a837 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -12,7 +12,6 @@
#define MAX_RANDOMMONSTER 4
-#define MAX_MOB_RACE_DB 6
// Change this to increase the table size in your mob_db to accomodate a larger mob database.
// Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
diff --git a/src/map/pc.c b/src/map/pc.c
index e93ae8a93..c52a61003 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -27,7 +27,6 @@
#include "homunculus.h"
#include "instance.h"
#include "mercenary.h"
-#include "mob.h" // MAX_MOB_RACE_DB
#include "npc.h" // fake_nd
#include "pet.h" // pet_unlocktarget()
#include "party.h" // party_search()
@@ -2741,7 +2740,7 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
}
break;
case SP_ADDRACE2:
- if (!(type2 > 0 && type2 < MAX_MOB_RACE_DB))
+ if (!(type2 > RC2_NONE && type2 < RC2_MAX))
break;
if(sd->state.lr_flag != 2)
sd->right_weapon.addrace2[type2] += val;
@@ -2753,6 +2752,8 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val)
sd->subsize[type2]+=val;
break;
case SP_SUBRACE2:
+ if (!(type2 > RC2_NONE && type2 < RC2_MAX))
+ break;
if(sd->state.lr_flag != 2)
sd->subrace2[type2]+=val;
break;
diff --git a/src/map/pc.h b/src/map/pc.h
index 374488609..7bf3a050f 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -31,7 +31,7 @@ struct weapon_data {
int def_ratio_atk_race;
int addele[ELE_MAX];
int addrace[RC_MAX];
- int addrace2[RC_MAX];
+ int addrace2[RC2_MAX];
int addsize[3];
struct drain_data {
@@ -219,7 +219,7 @@ struct map_session_data {
int param_bonus[6],param_equip[6]; //Stores card/equipment bonuses.
int subele[ELE_MAX];
int subrace[RC_MAX];
- int subrace2[RC_MAX];
+ int subrace2[RC2_MAX];
int subsize[3];
int reseff[SC_COMMON_MAX-SC_COMMON_MIN+1];
int weapon_coma_ele[ELE_MAX];