summaryrefslogtreecommitdiff
path: root/src/map/clif.c
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/clif.c
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/clif.c')
-rw-r--r--src/map/clif.c17
1 files changed, 17 insertions, 0 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;
}