summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorDastgir <dastgirpojee@rocketmail.com>2016-01-17 19:02:46 +0530
committerHaru <haru@dotalux.com>2016-03-19 22:27:31 +0100
commitf5ff79f1aca3e3fd1621913e275b0fc50a2cf062 (patch)
tree68cf723c49f20a9dbc948feff7181a8cfa1f44c7 /src/map
parentadd2ea4f7944ccabfcaa67be9d9ee5a57fbfb97e (diff)
downloadhercules-f5ff79f1aca3e3fd1621913e275b0fc50a2cf062.tar.gz
hercules-f5ff79f1aca3e3fd1621913e275b0fc50a2cf062.tar.bz2
hercules-f5ff79f1aca3e3fd1621913e275b0fc50a2cf062.tar.xz
hercules-f5ff79f1aca3e3fd1621913e275b0fc50a2cf062.zip
status_get_name returns NULL instead of Unknown, Changed all functions to use clif_get_bl_name
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/script.c6
-rw-r--r--src/map/skill.c8
-rw-r--r--src/map/status.c8
4 files changed, 16 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index d7f47eadd..c678849b3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -13284,7 +13284,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) {
case BL_PC:
{
char command[NAME_LENGTH+6];
- sprintf(command, "%ckick %s", atcommand->at_symbol, status->get_name(target));
+ sprintf(command, "%ckick %s", atcommand->at_symbol, clif->get_bl_name(target));
atcommand->exec(fd, sd, command, true);
}
break;
@@ -13299,7 +13299,7 @@ void clif_parse_GMKick(int fd, struct map_session_data *sd) {
clif->GM_kickack(sd, 0);
return;
}
- sprintf(command, "/kick %s (%d)", status->get_name(target), status->get_class(target));
+ sprintf(command, "/kick %s (%d)", clif->get_bl_name(target), status->get_class(target));
logs->atcommand(sd, command);
status_percent_damage(&sd->bl, target, 100, 0, true); // can invalidate 'target'
}
diff --git a/src/map/script.c b/src/map/script.c
index 67413669b..1128f400f 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -235,9 +235,9 @@ void script_reportsrc(struct script_state *st) {
break;
default:
if( bl->m >= 0 )
- ShowDebug("Source (Non-NPC type %u): name %s at %s (%d,%d)\n", bl->type, status->get_name(bl), map->list[bl->m].name, bl->x, bl->y);
+ ShowDebug("Source (Non-NPC type %u): name %s at %s (%d,%d)\n", bl->type, clif->get_bl_name(bl), map->list[bl->m].name, bl->x, bl->y);
else
- ShowDebug("Source (Non-NPC type %u): name %s (invisible/not on a map)\n", bl->type, status->get_name(bl));
+ ShowDebug("Source (Non-NPC type %u): name %s (invisible/not on a map)\n", bl->type, clif->get_bl_name(bl));
break;
}
}
@@ -16817,7 +16817,7 @@ BUILDIN(unittalk) {
if( bl != NULL ) {
struct StringBuf sbuf;
StrBuf->Init(&sbuf);
- StrBuf->Printf(&sbuf, "%s : %s", status->get_name(bl), message);
+ StrBuf->Printf(&sbuf, "%s : %s", clif->get_bl_name(bl), message);
clif->disp_overhead(bl, StrBuf->Value(&sbuf));
StrBuf->Destroy(&sbuf);
}
diff --git a/src/map/skill.c b/src/map/skill.c
index 8271991fe..13418fece 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -9667,7 +9667,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
if(sd) {
struct mob_data *summon_md;
- summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src), MOBID_KO_KAGE, "", SZ_SMALL, AI_NONE);
+ summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, clif->get_bl_name(src), MOBID_KO_KAGE, "", SZ_SMALL, AI_NONE);
if( summon_md ) {
summon_md->master_id = src->id;
summon_md->special_state.ai = AI_ZANZOU;
@@ -9847,7 +9847,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin
break;
for (i = 0; i < summons[skill_lv-1].quantity; i++) {
- struct mob_data *summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, status->get_name(src),
+ struct mob_data *summon_md = mob->once_spawn_sub(src, src->m, src->x, src->y, clif->get_bl_name(src),
summons[skill_lv-1].mob_id, "", SZ_SMALL, AI_ATTACK);
if (summon_md != NULL) {
summon_md->master_id = src->id;
@@ -10588,7 +10588,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
}
// Correct info, don't change any of this! [Celest]
- md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_SMALL, AI_NONE);
+ md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), class_, "", SZ_SMALL, AI_NONE);
if (md) {
md->master_id = src->id;
md->special_state.ai = (skill_id == AM_SPHEREMINE) ? AI_SPHERE : AI_FLORA;
@@ -10833,7 +10833,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case NC_SILVERSNIPER:
{
- struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), MOBID_SILVERSNIPER, "", SZ_SMALL, AI_NONE);
+ struct mob_data *md = mob->once_spawn_sub(src, src->m, x, y, clif->get_bl_name(src), MOBID_SILVERSNIPER, "", SZ_SMALL, AI_NONE);
if (md) {
md->master_id = src->id;
md->special_state.ai = AI_FLORA;
diff --git a/src/map/status.c b/src/map/status.c
index 55c95a987..2f0007b8f 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6243,6 +6243,12 @@ uint32 status_calc_mode(const struct block_list *bl, const struct status_change
return mode & MD_MASK;
}
+/**
+ * Returns the name of the given bl.
+ *
+ * @param bl The requested bl.
+ * @return The bl's name or NULL if not available.
+ */
const char *status_get_name(const struct block_list *bl)
{
nullpo_ret(bl);
@@ -6259,7 +6265,7 @@ const char *status_get_name(const struct block_list *bl)
case BL_HOM: return BL_UCCAST(BL_HOM, bl)->homunculus.name;
case BL_NPC: return BL_UCCAST(BL_NPC, bl)->name;
}
- return "Unknown";
+ return NULL;
}
/*==========================================