summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-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,
};
/**