summaryrefslogtreecommitdiff
path: root/src/map/clif.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/clif.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/clif.c')
-rw-r--r--src/map/clif.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 0b8f6c2ee..262ea1c57 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -14220,28 +14220,21 @@ void clif_ranklist(struct map_session_data *sd, enum fame_list_type type)
{
#if PACKETVER >= 20120502
int fd;
- int mypoint = 0;
- int upperMask;
int len = packet_len(0x97d);
nullpo_retv(sd);
fd = sd->fd;
- upperMask = sd->job & MAPID_UPPERMASK;
WFIFOHEAD(fd, len);
WFIFOW(fd, 0) = 0x97d;
WFIFOW(fd, 2) = type;
clif_ranklist_sub(WFIFOP(fd,4), type);
- if( (upperMask == MAPID_BLACKSMITH && type == RANKTYPE_BLACKSMITH)
- || (upperMask == MAPID_ALCHEMIST && type == RANKTYPE_ALCHEMIST)
- || (upperMask == MAPID_TAEKWON && type == RANKTYPE_TAEKWON)
- ) {
- mypoint = sd->status.fame;
+ if (pc->famelist_type(sd->job) == type) {
+ WFIFOL(fd, 284) = sd->status.fame; //mypoint
} else {
- mypoint = 0;
+ WFIFOL(fd, 284) = 0; //mypoint
}
- WFIFOL(fd, 284) = mypoint; //mypoint
WFIFOSET(fd, len);
#endif
}