summaryrefslogtreecommitdiff
path: root/src/char/inter.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-11-30 02:58:47 +0100
committerHaru <haru@dotalux.com>2016-12-03 15:38:55 +0100
commitcfa4ae95efca5557d085c56815259f47e6f380fb (patch)
treee08b55a2c9fb546f7f2ed41977f1e0bb8041e445 /src/char/inter.c
parentb0fde17b0ee155f1123e9ae6148ddd2df88cd965 (diff)
downloadhercules-cfa4ae95efca5557d085c56815259f47e6f380fb.tar.gz
hercules-cfa4ae95efca5557d085c56815259f47e6f380fb.tar.bz2
hercules-cfa4ae95efca5557d085c56815259f47e6f380fb.tar.xz
hercules-cfa4ae95efca5557d085c56815259f47e6f380fb.zip
Clarify some Job Class vs MapID confusion (1/2)
This commit ensures that `sd->status.class` and related variables only contain Job Classes (i.e. the client-compatible values, where High Novice 4001) and are never checked against the bitmask-based MapID values. As a rule of thumb, from now on, when a variable is named `class`, it is intended to contain a Job Class ID and not a MapID. The type of such variable shall be a signed `int16` or `int`. To ensure that related third party code is also verified when this commit is merged, the variable `struct mmo_charstatus::class_ (i.e. `sd->status.class_`) is renamed to `class`. Some issues in related lines are also fixed, including: - A wrong check in the char server would prevent the correct detection of babies in code related to the family exp sharing. - Baby Arch Bishops would not be affected by Eucharistica. - A wrong check would cause the `questinfo()` script command not to display its information for most classes (except 1-1 classes). - Map IDs and Job Classes were mixed up in `itemdb_jobid2mapid()` and `itemdb_jobmask2mapid()` for 1-1 classes (causing currently no harm, since they just happen to coincide). - The Baby Sura class would not cause parties to be marked as containing a monk type character (for SLS Team Up purposes). - Baby Geneticists would bypass the cart check when trying to equip ammunitions. - Baby Mechanics would bypass the Mado Gear check when trying to equip ammunitions. - Transcendent Shadow Chasers would lose the Stalkers' ability to clone transcendent skills. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/inter.c')
-rw-r--r--src/char/inter.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/char/inter.c b/src/char/inter.c
index fd3fe8c16..d076bb657 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -168,9 +168,9 @@ void inter_do_final_msg(void)
aFree(msg_table[i]);
}
/* from pc.c due to @accinfo. any ideas to replace this crap are more than welcome. */
-const char* inter_job_name(int class_)
+const char* inter_job_name(int class)
{
- switch (class_) {
+ switch (class) {
case JOB_NOVICE: // 550
case JOB_SWORDMAN: // 551
case JOB_MAGE: // 552
@@ -178,7 +178,7 @@ const char* inter_job_name(int class_)
case JOB_ACOLYTE: // 554
case JOB_MERCHANT: // 555
case JOB_THIEF: // 556
- return inter->msg_txt(550 - JOB_NOVICE+class_);
+ return inter->msg_txt(550 - JOB_NOVICE + class);
case JOB_KNIGHT: // 557
case JOB_PRIEST: // 558
@@ -186,7 +186,7 @@ const char* inter_job_name(int class_)
case JOB_BLACKSMITH: // 560
case JOB_HUNTER: // 561
case JOB_ASSASSIN: // 562
- return inter->msg_txt(557 - JOB_KNIGHT+class_);
+ return inter->msg_txt(557 - JOB_KNIGHT + class);
case JOB_KNIGHT2:
return inter->msg_txt(557);
@@ -198,7 +198,7 @@ const char* inter_job_name(int class_)
case JOB_ALCHEMIST: // 567
case JOB_BARD: // 568
case JOB_DANCER: // 569
- return inter->msg_txt(563 - JOB_CRUSADER+class_);
+ return inter->msg_txt(563 - JOB_CRUSADER + class);
case JOB_CRUSADER2:
return inter->msg_txt(563);
@@ -208,7 +208,7 @@ const char* inter_job_name(int class_)
case JOB_GUNSLINGER: // 572
case JOB_NINJA: // 573
case JOB_XMAS: // 574
- return inter->msg_txt(570 - JOB_WEDDING+class_);
+ return inter->msg_txt(570 - JOB_WEDDING + class);
case JOB_SUMMER:
return inter->msg_txt(621);
@@ -220,7 +220,7 @@ const char* inter_job_name(int class_)
case JOB_ACOLYTE_HIGH: // 579
case JOB_MERCHANT_HIGH: // 580
case JOB_THIEF_HIGH: // 581
- return inter->msg_txt(575 - JOB_NOVICE_HIGH+class_);
+ return inter->msg_txt(575 - JOB_NOVICE_HIGH + class);
case JOB_LORD_KNIGHT: // 582
case JOB_HIGH_PRIEST: // 583
@@ -228,7 +228,7 @@ const char* inter_job_name(int class_)
case JOB_WHITESMITH: // 585
case JOB_SNIPER: // 586
case JOB_ASSASSIN_CROSS: // 587
- return inter->msg_txt(582 - JOB_LORD_KNIGHT+class_);
+ return inter->msg_txt(582 - JOB_LORD_KNIGHT + class);
case JOB_LORD_KNIGHT2:
return inter->msg_txt(582);
@@ -240,7 +240,7 @@ const char* inter_job_name(int class_)
case JOB_CREATOR: // 592
case JOB_CLOWN: // 593
case JOB_GYPSY: // 594
- return inter->msg_txt(588 - JOB_PALADIN + class_);
+ return inter->msg_txt(588 - JOB_PALADIN + class);
case JOB_PALADIN2:
return inter->msg_txt(588);
@@ -252,7 +252,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_ACOLYTE: // 599
case JOB_BABY_MERCHANT: // 600
case JOB_BABY_THIEF: // 601
- return inter->msg_txt(595 - JOB_BABY + class_);
+ return inter->msg_txt(595 - JOB_BABY + class);
case JOB_BABY_KNIGHT: // 602
case JOB_BABY_PRIEST: // 603
@@ -260,7 +260,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_BLACKSMITH: // 605
case JOB_BABY_HUNTER: // 606
case JOB_BABY_ASSASSIN: // 607
- return inter->msg_txt(602 - JOB_BABY_KNIGHT + class_);
+ return inter->msg_txt(602 - JOB_BABY_KNIGHT + class);
case JOB_BABY_KNIGHT2:
return inter->msg_txt(602);
@@ -272,7 +272,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_ALCHEMIST: // 612
case JOB_BABY_BARD: // 613
case JOB_BABY_DANCER: // 614
- return inter->msg_txt(608 - JOB_BABY_CRUSADER + class_);
+ return inter->msg_txt(608 - JOB_BABY_CRUSADER + class);
case JOB_BABY_CRUSADER2:
return inter->msg_txt(608);
@@ -291,7 +291,7 @@ const char* inter_job_name(int class_)
case JOB_GANGSI: // 622
case JOB_DEATH_KNIGHT: // 623
case JOB_DARK_COLLECTOR: // 624
- return inter->msg_txt(622 - JOB_GANGSI+class_);
+ return inter->msg_txt(622 - JOB_GANGSI + class);
case JOB_RUNE_KNIGHT: // 625
case JOB_WARLOCK: // 626
@@ -299,7 +299,7 @@ const char* inter_job_name(int class_)
case JOB_ARCH_BISHOP: // 628
case JOB_MECHANIC: // 629
case JOB_GUILLOTINE_CROSS: // 630
- return inter->msg_txt(625 - JOB_RUNE_KNIGHT+class_);
+ return inter->msg_txt(625 - JOB_RUNE_KNIGHT + class);
case JOB_RUNE_KNIGHT_T: // 656
case JOB_WARLOCK_T: // 657
@@ -307,7 +307,7 @@ const char* inter_job_name(int class_)
case JOB_ARCH_BISHOP_T: // 659
case JOB_MECHANIC_T: // 660
case JOB_GUILLOTINE_CROSS_T: // 661
- return inter->msg_txt(656 - JOB_RUNE_KNIGHT_T+class_);
+ return inter->msg_txt(656 - JOB_RUNE_KNIGHT_T + class);
case JOB_ROYAL_GUARD: // 631
case JOB_SORCERER: // 632
@@ -316,7 +316,7 @@ const char* inter_job_name(int class_)
case JOB_SURA: // 635
case JOB_GENETIC: // 636
case JOB_SHADOW_CHASER: // 637
- return inter->msg_txt(631 - JOB_ROYAL_GUARD+class_);
+ return inter->msg_txt(631 - JOB_ROYAL_GUARD + class);
case JOB_ROYAL_GUARD_T: // 662
case JOB_SORCERER_T: // 663
@@ -325,7 +325,7 @@ const char* inter_job_name(int class_)
case JOB_SURA_T: // 666
case JOB_GENETIC_T: // 667
case JOB_SHADOW_CHASER_T: // 668
- return inter->msg_txt(662 - JOB_ROYAL_GUARD_T+class_);
+ return inter->msg_txt(662 - JOB_ROYAL_GUARD_T + class);
case JOB_RUNE_KNIGHT2:
return inter->msg_txt(625);
@@ -364,7 +364,7 @@ const char* inter_job_name(int class_)
case JOB_BABY_SURA: // 648
case JOB_BABY_GENETIC: // 649
case JOB_BABY_CHASER: // 650
- return inter->msg_txt(638 - JOB_BABY_RUNE+class_);
+ return inter->msg_txt(638 - JOB_BABY_RUNE + class);
case JOB_BABY_RUNE2:
return inter->msg_txt(638);
@@ -380,11 +380,11 @@ const char* inter_job_name(int class_)
case JOB_SUPER_NOVICE_E: // 651
case JOB_SUPER_BABY_E: // 652
- return inter->msg_txt(651 - JOB_SUPER_NOVICE_E+class_);
+ return inter->msg_txt(651 - JOB_SUPER_NOVICE_E + class);
case JOB_KAGEROU: // 653
case JOB_OBORO: // 654
- return inter->msg_txt(653 - JOB_KAGEROU+class_);
+ return inter->msg_txt(653 - JOB_KAGEROU + class);
case JOB_REBELLION:
return inter->msg_txt(655);
@@ -477,18 +477,18 @@ void mapif_parse_accinfo(int fd)
} else {// more than one, listing... [Dekamaster/Nightroad]
inter->msg_to_fd(fd, u_fd, aid, "Your query returned the following %d results, please be more specific...",(int)SQL->NumRows(inter->sql_handle));
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
- int class_;
+ int class;
int base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); account_id = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); safestrncpy(name, data, sizeof(name));
- SQL->GetData(inter->sql_handle, 2, &data, NULL); class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 2, &data, NULL); class = atoi(data);
SQL->GetData(inter->sql_handle, 3, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); job_level = atoi(data);
SQL->GetData(inter->sql_handle, 5, &data, NULL); online = atoi(data);
- inter->msg_to_fd(fd, u_fd, aid, "[AID: %d] %s | %s | Level: %d/%d | %s", account_id, name, inter->job_name(class_), base_level, job_level, online?"Online":"Offline");
+ inter->msg_to_fd(fd, u_fd, aid, "[AID: %d] %s | %s | Level: %d/%d | %s", account_id, name, inter->job_name(class), base_level, job_level, online?"Online":"Offline");
}
SQL->FreeResult(inter->sql_handle);
return;
@@ -549,19 +549,19 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc
} else {
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
char *data;
- int char_id, class_;
+ int char_id, class;
int char_num, base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); char_id = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); safestrncpy(name, data, sizeof(name));
SQL->GetData(inter->sql_handle, 2, &data, NULL); char_num = atoi(data);
- SQL->GetData(inter->sql_handle, 3, &data, NULL); class_ = atoi(data);
+ SQL->GetData(inter->sql_handle, 3, &data, NULL); class = atoi(data);
SQL->GetData(inter->sql_handle, 4, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 5, &data, NULL); job_level = atoi(data);
SQL->GetData(inter->sql_handle, 6, &data, NULL); online = atoi(data);
- inter->msg_to_fd(map_fd, u_fd, u_aid, "[Slot/CID: %d/%d] %s | %s | Level: %d/%d | %s", char_num, char_id, name, inter->job_name(class_), base_level, job_level, online?"On":"Off");
+ inter->msg_to_fd(map_fd, u_fd, u_aid, "[Slot/CID: %d/%d] %s | %s | Level: %d/%d | %s", char_num, char_id, name, inter->job_name(class), base_level, job_level, online?"On":"Off");
}
}
SQL->FreeResult(inter->sql_handle);