summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-08 02:50:28 +0200
committerHaru <haru@dotalux.com>2016-07-08 02:50:28 +0200
commitc7b95260fa3f4d77138fa34710f60365f4c86c87 (patch)
treee0cef7581f33a0e50435ec0d22cf6754f4efe467 /src
parent72a06cdfa933534319a99cecc781b56acecce9cd (diff)
downloadhercules-c7b95260fa3f4d77138fa34710f60365f4c86c87.tar.gz
hercules-c7b95260fa3f4d77138fa34710f60365f4c86c87.tar.bz2
hercules-c7b95260fa3f4d77138fa34710f60365f4c86c87.tar.xz
hercules-c7b95260fa3f4d77138fa34710f60365f4c86c87.zip
Fixed a compilation error on packetvers older than 20071106
Fixes #1345 Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c66
-rw-r--r--src/map/clif.h22
2 files changed, 48 insertions, 40 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 8aa225878..0f6e985fd 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -265,42 +265,50 @@ uint32 clif_refresh_ip(void)
return 0;
}
+unsigned char clif_bl_type(struct block_list *bl)
+{
#if PACKETVER >= 20071106
-unsigned char clif_bl_type(struct block_list *bl) {
struct view_data *vd;
nullpo_retr(CLUT_NPC, bl);
switch (bl->type) {
- case BL_PC:
- vd = status->get_viewdata(bl);
- nullpo_retr(CLUT_NPC, vd);
-
- if (clif->isdisguised(bl) && !pc->db_checkid(vd->class_))
- return CLUT_NPC;
- else
- return CLUT_PC;
- case BL_ITEM: return CLUT_ITEM;
- case BL_SKILL: return CLUT_SKILL;
- case BL_CHAT: return CLUT_UNKNOW;
- case BL_MOB:
- vd = status->get_viewdata(bl);
- nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_)? CLUT_PC:CLUT_MOB;
- case BL_NPC:
- vd = status->get_viewdata(bl);
- nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_)? CLUT_PC:CLUT_EVENT;
- case BL_PET:
- vd = status->get_viewdata(bl);
- nullpo_retr(CLUT_NPC, vd);
- return pc->db_checkid(vd->class_)? CLUT_PC:CLUT_PET;
- case BL_HOM: return CLUT_HOMNUCLUS;
- case BL_MER: return CLUT_MERCNARY;
- case BL_ELEM: return CLUT_ELEMENTAL;
- default: return CLUT_NPC;
+ case BL_PC:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+
+ if (clif->isdisguised(bl) && !pc->db_checkid(vd->class_))
+ return CLUT_NPC;
+ return CLUT_PC;
+ case BL_ITEM:
+ return CLUT_ITEM;
+ case BL_SKILL:
+ return CLUT_SKILL;
+ case BL_CHAT:
+ return CLUT_UNKNOWN;
+ case BL_MOB:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_MOB;
+ case BL_NPC:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_EVENT;
+ case BL_PET:
+ vd = status->get_viewdata(bl);
+ nullpo_retr(CLUT_NPC, vd);
+ return pc->db_checkid(vd->class_) ? CLUT_PC : CLUT_PET;
+ case BL_HOM:
+ return CLUT_HOMNUCLUS;
+ case BL_MER:
+ return CLUT_MERCNARY;
+ case BL_ELEM:
+ return CLUT_ELEMENTAL;
+ default:
+ return CLUT_NPC;
}
-}
#endif
+ return CLUT_UNKNOWN;
+}
/*==========================================
* sub process of clif_send
diff --git a/src/map/clif.h b/src/map/clif.h
index 9dd8e35f0..df8b8f59c 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -546,17 +546,17 @@ enum mergeitem_reason {
* Clif Unit Type
**/
enum clif_unittype {
- CLUT_PC = 0x0,
- CLUT_NPC = 0x1,
- CLUT_ITEM = 0x2,
- CLUT_SKILL = 0x3,
- CLUT_UNKNOW = 0x4,
- CLUT_MOB = 0x5,
- CLUT_EVENT = 0x6,
- CLUT_PET = 0x7,
- CLUT_HOMNUCLUS = 0x8,
- CLUT_MERCNARY = 0x9,
- CLUT_ELEMENTAL = 0xa,
+ CLUT_PC = 0x0,
+ CLUT_NPC = 0x1,
+ CLUT_ITEM = 0x2,
+ CLUT_SKILL = 0x3,
+ CLUT_UNKNOWN = 0x4,
+ CLUT_MOB = 0x5,
+ CLUT_EVENT = 0x6,
+ CLUT_PET = 0x7,
+ CLUT_HOMNUCLUS = 0x8,
+ CLUT_MERCNARY = 0x9,
+ CLUT_ELEMENTAL = 0xa,
};
/**