summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-12-03 04:45:12 +0100
committerHaru <haru@dotalux.com>2016-12-03 15:38:57 +0100
commita222f21b459eb6abc0862695526c1d15361a99e0 (patch)
tree52e1732a43ebd4dedca7aa2a9ccaf76add58f0c2 /src/map/chrif.c
parent8a9e589446058b33972aff2c054f8c300b3fd1b7 (diff)
downloadhercules-a222f21b459eb6abc0862695526c1d15361a99e0.tar.gz
hercules-a222f21b459eb6abc0862695526c1d15361a99e0.tar.bz2
hercules-a222f21b459eb6abc0862695526c1d15361a99e0.tar.xz
hercules-a222f21b459eb6abc0862695526c1d15361a99e0.zip
Add function to retrieve the appropriate fame list type for a job mapid
This commit adds the function `pc->famelist_type()` to retrieve the appropriate fame list for a given job (common operation). When the given job ID doesn't have an appropriate fame list, the newly introduced value RANKTYPE_UNKNOWN is returned. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index e298a7fbc..bf613b029 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -1059,25 +1059,17 @@ int chrif_disconnectplayer(int fd) {
/*==========================================
* Request/Receive top 10 Fame character list
*------------------------------------------*/
-int chrif_updatefamelist(struct map_session_data* sd) {
- char type;
+int chrif_updatefamelist(struct map_session_data *sd)
+{
+ int type;
nullpo_retr(0, sd);
chrif_check(-1);
- switch (sd->job & MAPID_UPPERMASK) {
- case MAPID_BLACKSMITH:
- type = RANKTYPE_BLACKSMITH;
- break;
- case MAPID_ALCHEMIST:
- type = RANKTYPE_ALCHEMIST;
- break;
- case MAPID_TAEKWON:
- type = RANKTYPE_TAEKWON;
- break;
- default:
+ type = pc->famelist_type(sd->job);
+
+ if (type == RANKTYPE_UNKNOWN)
return 0;
- }
WFIFOHEAD(chrif->fd, 11);
WFIFOW(chrif->fd,0) = 0x2b10;