summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 12c805ef3..762cf1446 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1659,8 +1659,30 @@ struct mob_data * map_id2md(int id)
struct npc_data * map_id2nd(int id)
{// just a id2bl lookup because there's no npc_db
- if (id <= 0) return NULL;
- return (struct npc_data*)map_id2bl(id);
+ struct block_list* bl = map_id2bl(id);
+
+ return BL_CAST(BL_NPC, bl);
+}
+
+struct homun_data* map_id2hd(int id)
+{
+ struct block_list* bl = map_id2bl(id);
+
+ return BL_CAST(BL_HOM, bl);
+}
+
+struct mercenary_data* map_id2mc(int id)
+{
+ struct block_list* bl = map_id2bl(id);
+
+ return BL_CAST(BL_MER, bl);
+}
+
+struct chat_data* map_id2cd(int id)
+{
+ struct block_list* bl = map_id2bl(id);
+
+ return BL_CAST(BL_CHAT, bl);
}
/// Returns the nick of the target charid or NULL if unknown (requests the nick to the char server).