summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-12 05:58:58 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-08-12 05:58:58 +0000
commit1c6443a7ab88539acf5e456c0911dbdd8b674582 (patch)
tree233d8764dc81ba713dd0d5391c767ea9e501fd66
parented8c27d7fd6a98cac15020ff2f72dfceabf1957d (diff)
downloadhercules-1c6443a7ab88539acf5e456c0911dbdd8b674582.tar.gz
hercules-1c6443a7ab88539acf5e456c0911dbdd8b674582.tar.bz2
hercules-1c6443a7ab88539acf5e456c0911dbdd8b674582.tar.xz
hercules-1c6443a7ab88539acf5e456c0911dbdd8b674582.zip
Now using proper enum type for mob skill state tracking.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13075 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/mob.h33
2 files changed, 17 insertions, 18 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index fc75e9567..7b3058508 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3981,7 +3981,7 @@ static int mob_readskilldb(void)
const struct {
char str[32];
- int id;
+ enum MobSkillState id;
} cond1[] = {
{ "always", MSC_ALWAYS },
{ "myhpltmaxrate", MSC_MYHPLTMAXRATE },
diff --git a/src/map/mob.h b/src/map/mob.h
index 3f9ef09a6..a0706944a 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -35,8 +35,22 @@
#define MOB_CLONE_START (MAX_MOB_DB-999)
#define MOB_CLONE_END MAX_MOB_DB
+//Mob skill states.
+enum MobSkillState {
+ MSS_ANY = -1,
+ MSS_IDLE,
+ MSS_WALK,
+ MSS_LOOT,
+ MSS_DEAD,
+ MSS_BERSERK, //Aggressive mob attacking
+ MSS_ANGRY, //Mob retaliating from being attacked.
+ MSS_RUSH, //Mob following a player after being attacked.
+ MSS_FOLLOW, //Mob following a player without being attacked.
+ MSS_ANYTARGET,
+};
+
struct mob_skill {
- short state;
+ enum MobSkillState state;
short skill_id,skill_lv;
short permillage;
int casttime,delay;
@@ -88,7 +102,7 @@ struct mob_data {
//3: Alchemist Summon Flora
} special_state; //Special mob information that does not needs to be zero'ed on mob respawn.
struct {
- unsigned skillstate : 8;
+ enum MobSkillState skillstate;
unsigned aggressive : 1; //Signals whether the mob AI is in aggressive mode or reactive mode. [Skotlex]
unsigned char steal_flag; //number of steal tries (to prevent steal exploit on mobs with few items) [Lupus]
unsigned steal_coin_flag : 1;
@@ -171,21 +185,6 @@ enum {
MSC_SPAWN,
};
-//Mob skill states.
-enum {
- MSS_ANY = -1,
- MSS_IDLE,
- MSS_WALK,
- MSS_LOOT,
- MSS_DEAD,
- MSS_BERSERK, //Aggressive mob attacking
- MSS_ANGRY, //Mob retaliating from being attacked.
- MSS_RUSH, //Mob following a player after being attacked.
- MSS_FOLLOW, //Mob following a player without being attacked.
- MSS_ANYTARGET,
-};
-
-
// The data structures for storing delayed item drops
struct item_drop {
struct item item_data;