summaryrefslogtreecommitdiff
path: root/src/map/pc.h
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-24 13:02:00 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-24 13:02:00 +0000
commit339ac6c105cc0548328e15adce1f94d7ecddb0bc (patch)
tree6f58fd8315d917657445a115fc0800c360c873c3 /src/map/pc.h
parent3ecde465534c93315a1f88430129e8400f4d9fe2 (diff)
downloadhercules-339ac6c105cc0548328e15adce1f94d7ecddb0bc.tar.gz
hercules-339ac6c105cc0548328e15adce1f94d7ecddb0bc.tar.bz2
hercules-339ac6c105cc0548328e15adce1f94d7ecddb0bc.tar.xz
hercules-339ac6c105cc0548328e15adce1f94d7ecddb0bc.zip
- added defines JOB_MAX_BASIC and JOB_MAX to mmo.h so the code can know which are the max valid classes.
- @/#jobchange no longer strip your equipment since pc_jobchange removes any unequippables already. - removed the wasteful define MAX_PC_CLASS and replaced it by the CLASS_COUNT define (which is automatically updated using the previous JOB_MAX* defines) + pc_class2idx function (which converts high class IDs into values that fit in CLASS_COUNT) - Made status_charge a function rather than a define to get rid of those warnings that have been there since forever. - Merged the CELL_NOVENDING code (see topic #129209) - Small check that disables the pet catching process if you try to use another item. - Added a check to fix a warning and prevent a crash in the npc duplicate check (even though I have no idea what this check is supposed to do, therefore I can't fix it properly other than to avoid the crash) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11572 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.h')
-rw-r--r--src/map/pc.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/map/pc.h b/src/map/pc.h
index 442c9e188..05368d6d5 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -7,12 +7,14 @@
#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus
#include "../common/timer.h" // INVALID_TIMER
#include "battle.h" // battle_config
-#include "map.h" // MAX_PC_CLASS, struct map_session_data
+#include "map.h" // struct map_session_data
#include "status.h" // OPTION_*
#include "unit.h" // unit_stop_attack(), unit_stop_walking()
//Update this max as necessary. 54 is the value needed for Super Baby currently
#define MAX_SKILL_TREE 54
+//Total number of classes (for data storage)
+#define CLASS_COUNT (JOB_MAX - JOB_NOVICE_HIGH + JOB_MAX_BASIC)
enum {
W_FIST, //Bare hands
@@ -115,8 +117,9 @@ enum {
#define pc_check_weapontype(sd, type) ((type)&((sd)->status.weapon < MAX_WEAPON_TYPE? \
1<<(sd)->status.weapon:(1<<(sd)->weapontype1)|(1<<(sd)->weapontype2)))
//Checks if the given class value corresponds to a player class. [Skotlex]
-#define pcdb_checkid(class_) (class_ <= JOB_SUMMER || (class_ >= JOB_NOVICE_HIGH && class_ <= JOB_SOUL_LINKER))
+#define pcdb_checkid(class_) (class_ < JOB_MAX_BASIC || (class_ >= JOB_NOVICE_HIGH && class_ < JOB_MAX))
+int pc_class2idx(int class_);
int pc_isGM(struct map_session_data *sd);
int pc_getrefinebonus(int lv,int type);
int pc_can_give_items(int level); //[Lupus]
@@ -289,7 +292,7 @@ struct skill_tree_entry {
unsigned char lv;
} need[5];
}; // Celest
-extern struct skill_tree_entry skill_tree[MAX_PC_CLASS][MAX_SKILL_TREE];
+extern struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE];
int pc_read_gm_account(int fd);
void pc_setinvincibletimer(struct map_session_data* sd, int val);