summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2016-01-17 19:00:24 +0530
committerHaru <haru@dotalux.com>2016-03-19 22:26:27 +0100
commitadd2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e (patch)
tree66c86a6da45b54c9435d86a8eaa200b44dd38bab /src/map
parentbba3416bb2ce9939fce0fbbce238b267462e99cf (diff)
downloadhercules-add2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e.tar.gz
hercules-add2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e.tar.bz2
hercules-add2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e.tar.xz
hercules-add2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e.zip
Implemented new function clif_get_bl_name
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c17
-rw-r--r--src/map/clif.h6
2 files changed, 21 insertions, 2 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 71409fab4..d7f47eadd 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -18760,6 +18760,22 @@ void clif_selectcart(struct map_session_data *sd)
#endif
}
+/**
+ * Returns the name of the given bl, in a client-friendly format.
+ *
+ * @param bl The requested bl.
+ * @return The bl's name (guaranteed to be non-NULL).
+ */
+const char *clif_get_bl_name(const struct block_list *bl)
+{
+ const char *name = status->get_name(bl);
+
+ if (name == NULL)
+ return "Unknown";
+
+ return name;
+}
+
/* */
unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
if( sd ) {
@@ -19829,4 +19845,5 @@ void clif_defaults(void) {
clif->pHotkeyRowShift = clif_parse_HotkeyRowShift;
clif->dressroom_open = clif_dressroom_open;
clif->pOneClick_ItemIdentify = clif_parse_OneClick_ItemIdentify;
+ clif->get_bl_name = clif_get_bl_name;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index ac0191210..f930e4ca1 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1334,8 +1334,10 @@ struct clif_interface {
void (*dressroom_open) (struct map_session_data *sd, int view);
void (*pOneClick_ItemIdentify) (int fd,struct map_session_data *sd);
/* Cart Deco */
- void(*selectcart) (struct map_session_data *sd);
- void(*pSelectCart) (int fd, struct map_session_data *sd);
+ void (*selectcart) (struct map_session_data *sd);
+ void (*pSelectCart) (int fd, struct map_session_data *sd);
+
+ const char *(*get_bl_name) (const struct block_list *bl);
};
#ifdef HERCULES_CORE