summaryrefslogtreecommitdiff
path: root/src/map/charcommand.c
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/charcommand.c
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/charcommand.c')
-rw-r--r--src/map/charcommand.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index f2747e6e1..c2689b8e8 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -421,7 +421,7 @@ int charcommand_jobchange(const int fd, struct map_session_data* sd, const char*
{
char character[100];
struct map_session_data* pl_sd;
- int job = 0, upper = -1, j = 0;
+ int job = 0, upper = -1;
memset(character, '\0', sizeof(character));
@@ -462,15 +462,11 @@ int charcommand_jobchange(const int fd, struct map_session_data* sd, const char*
return -1;
}
- if (job < 0 || job > MAX_PC_CLASS) {
+ if (!pcdb_checkid(job)) {
clif_displaymessage(fd, msg_txt(49)); // Invalid job ID.
return -1;
}
- for (j=0; j < MAX_INVENTORY; j++) {
- if(pl_sd->status.inventory[j].nameid>0 && pl_sd->status.inventory[j].equip!=0)
- pc_unequipitem(pl_sd, j, 3);
- }
if (pc_jobchange(pl_sd, job, upper) != 0) {
clif_displaymessage(fd, msg_txt(192)); // Impossible to change the character's job.
return -1;