summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprotimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-04 00:38:07 +0000
committerprotimus <protimus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-04 00:38:07 +0000
commit8538670a61c726fbd52087fe392f0a3d961db630 (patch)
tree4d37f0ac7e29780e7794dd6aba1856a80dbae4b4
parent2b6c40327a3e05a18bbfabd319a0735d75fbb8e9 (diff)
downloadhercules-8538670a61c726fbd52087fe392f0a3d961db630.tar.gz
hercules-8538670a61c726fbd52087fe392f0a3d961db630.tar.bz2
hercules-8538670a61c726fbd52087fe392f0a3d961db630.tar.xz
hercules-8538670a61c726fbd52087fe392f0a3d961db630.zip
Changed some defines into an enumerator.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15829 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/char/int_guild.h28
-rw-r--r--src/char/int_party.h20
-rw-r--r--src/common/core.h13
-rw-r--r--src/common/timer.h8
-rw-r--r--src/map/itemdb.h84
5 files changed, 82 insertions, 71 deletions
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index be1d16ab6..202b9b512 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -4,19 +4,21 @@
#ifndef _INT_GUILD_SQL_H_
#define _INT_GUILD_SQL_H_
-#define GS_BASIC 0x0001
-#define GS_MEMBER 0x0002
-#define GS_POSITION 0x0004
-#define GS_ALLIANCE 0x0008
-#define GS_EXPULSION 0x0010
-#define GS_SKILL 0x0020
-#define GS_EMBLEM 0x0040
-#define GS_CONNECT 0x0080
-#define GS_LEVEL 0x0100
-#define GS_MES 0x0200
-#define GS_MASK 0x03FF
-#define GS_BASIC_MASK (GS_BASIC | GS_EMBLEM | GS_CONNECT | GS_LEVEL | GS_MES)
-#define GS_REMOVE 0x8000
+enum {
+ GS_BASIC = 0x0001,
+ GS_MEMBER = 0x0002,
+ GS_POSITION = 0x0004,
+ GS_ALLIANCE = 0x0008,
+ GS_EXPULSION = 0x0010,
+ GS_SKILL = 0x0020,
+ GS_EMBLEM = 0x0040,
+ GS_CONNECT = 0x0080,
+ GS_LEVEL = 0x0100,
+ GS_MES = 0x0200,
+ GS_MASK = 0x03FF,
+ GS_BASIC_MASK = (GS_BASIC | GS_EMBLEM | GS_CONNECT | GS_LEVEL | GS_MES),
+ GS_REMOVE = 0x8000,
+};
struct guild;
struct guild_castle;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index d7965c33b..703cd5bd5 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -5,18 +5,14 @@
#define _INT_PARTY_SQL_H_
//Party Flags on what to save/delete.
-//Create a new party entry (index holds leader's info)
-#define PS_CREATE 0x01
-//Update basic party info.
-#define PS_BASIC 0x02
-//Update party's leader
-#define PS_LEADER 0x04
-//Specify new party member (index specifies which party member)
-#define PS_ADDMEMBER 0x08
-//Specify member that left (index specifies which party member)
-#define PS_DELMEMBER 0x10
-//Specify that this party must be deleted.
-#define PS_BREAK 0x20
+enum {
+ PS_CREATE = 0x01, //Create a new party entry (index holds leader's info)
+ PS_BASIC = 0x02, //Update basic party info.
+ PS_LEADER = 0x04, //Update party's leader
+ PS_ADDMEMBER = 0x08, //Specify new party member (index specifies which party member)
+ PS_DELMEMBER = 0x10, //Specify member that left (index specifies which party member)
+ PS_BREAK = 0x20, //Specify that this party must be deleted.
+};
struct party;
diff --git a/src/common/core.h b/src/common/core.h
index 11b4f7c47..d48962c94 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -15,11 +15,14 @@ extern char **arg_v;
extern int runflag;
extern char *SERVER_NAME;
-#define ATHENA_SERVER_NONE 0 // not defined
-#define ATHENA_SERVER_LOGIN 1 // login server
-#define ATHENA_SERVER_CHAR 2 // char server
-#define ATHENA_SERVER_INTER 4 // inter server
-#define ATHENA_SERVER_MAP 8 // map server
+enum {
+ ATHENA_SERVER_NONE = 0, // not defined
+ ATHENA_SERVER_LOGIN = 1, // login server
+ ATHENA_SERVER_CHAR = 2, // char server
+ ATHENA_SERVER_INTER = 4, // inter server
+ ATHENA_SERVER_MAP = 8, // map server
+};
+
extern char SERVER_TYPE;
extern int parse_console(const char* buf);
diff --git a/src/common/timer.h b/src/common/timer.h
index a615a5874..d45c73d12 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -11,9 +11,11 @@
#define INVALID_TIMER -1
// timer flags
-#define TIMER_ONCE_AUTODEL 0x01
-#define TIMER_INTERVAL 0x02
-#define TIMER_REMOVE_HEAP 0x10
+enum {
+ TIMER_ONCE_AUTODEL = 0x01,
+ TIMER_INTERVAL = 0x02,
+ TIMER_REMOVE_HEAP = 0x10,
+};
// Struct declaration
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index faab04fed..bcf9fad9f 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -17,11 +17,6 @@
#define MAX_SEARCH 5 //Designed for search functions, species max number of matches to display.
-/**
- * Arch Bishop
- **/
-#define ITEMID_ANCILLA 12333
-
enum item_itemid
{
ITEMID_EMPERIUM = 714,
@@ -32,10 +27,48 @@ enum item_itemid
ITEMID_STONE = 7049,
ITEMID_SKULL_ = 7420,
ITEMID_TOKEN_OF_SIEGFRIED = 7621,
+/**
+ * Ranger
+ **/
+ ITEMID_TRAP_ALLOY = 7940,
+/**
+ * Arch Bishop
+ **/
+ ITEMID_ANCILLA = 12333,
};
-#define itemid_isgemstone(id) ( (id) >= ITEMID_YELLOW_GEMSTONE && (id) <= ITEMID_BLUE_GEMSTONE )
-#define itemdb_iscashfood(id) ( (id) >= 12202 && (id) <= 12207 )
+/**
+ * Rune Knight
+ **/
+
+enum {
+ ITEMID_NAUTHIZ = 12725,
+ ITEMID_RAIDO,
+ ITEMID_BERKANA,
+ ITEMID_ISA,
+ ITEMID_OTHILA,
+ ITEMID_URUZ,
+ ITEMID_THURISAZ,
+ ITEMID_WYRD,
+ ITEMID_HAGALAZ,
+} rune_list;
+
+/**
+ * Mechanic
+ **/
+enum {
+ ITEMID_ACCELERATOR = 2800,
+ ITEMID_HOVERING_BOOSTER,
+ ITEMID_SUICIDAL_DEVICE,
+ ITEMID_SHAPE_SHIFTER,
+ ITEMID_COOLING_DEVICE,
+ ITEMID_MAGNETIC_FIELD_GENERATOR,
+ ITEMID_BARRIER_BUILDER,
+ ITEMID_REPAIR_KIT,
+ ITEMID_CAMOUFLAGE_GENERATOR,
+ ITEMID_HIGH_QUALITY_COOLER,
+ ITEMID_SPECIAL_COOLER,
+ } mecha_item_list;
//The only item group required by the code to be known. See const.txt for the full list.
#define IG_FINDINGORE 6
@@ -127,6 +160,12 @@ struct item_data* itemdb_exists(int nameid);
#define itemdb_available(n) (itemdb_search(n)->flag.available)
#define itemdb_viewid(n) (itemdb_search(n)->view_id)
#define itemdb_autoequip(n) (itemdb_search(n)->flag.autoequip)
+#define itemdb_is_rune(n) (n >= ITEMID_NAUTHIZ && n <= ITEMID_HAGALAZ)
+#define itemdb_is_element(n) (n >= 990 && n <= 993)
+#define itemdb_is_spellbook(n) (n >= 6188 && n <= 6205)
+#define itemdb_is_poison(n) (n >= 12717 && n <= 12724)
+#define itemid_isgemstone(id) ( (id) >= ITEMID_YELLOW_GEMSTONE && (id) <= ITEMID_BLUE_GEMSTONE )
+#define itemdb_iscashfood(id) ( (id) >= 12202 && (id) <= 12207 )
const char* itemdb_typename(int type);
int itemdb_group_bonus(struct map_session_data* sd, int itemid);
@@ -167,35 +206,4 @@ void itemdb_reload(void);
void do_final_itemdb(void);
int do_init_itemdb(void);
-/**
- * Rune Knight
- **/
-enum {
- ITEMID_NAUTHIZ = 12725,
- ITEMID_RAIDO,
- ITEMID_BERKANA,
- ITEMID_ISA,
- ITEMID_OTHILA,
- ITEMID_URUZ,
- ITEMID_THURISAZ,
- ITEMID_WYRD,
- ITEMID_HAGALAZ,
-} rune_list;
-#define itemdb_is_rune(n) (n >= ITEMID_NAUTHIZ && n <= ITEMID_HAGALAZ)
-/**
- * Warlock
- **/
-#define itemdb_is_spellbook(n) (n >= 6188 && n <= 6205)
-/**
- * Ranger
- **/
-#define ITEMID_TRAP_ALLOY 7940
-/**
- * Mechanic
- **/
-#define itemdb_is_element(n) (n >= 990 && n <= 993)
-/**
- * Guilotine Cross
- **/
-#define itemdb_is_poison(n) (n >= 12717 && n <= 12724)
#endif /* _ITEMDB_H_ */