summaryrefslogtreecommitdiff
path: root/src/map/battle.cpp
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2016-04-02 20:29:31 -0400
committermekolat <mekolat@users.noreply.github.com>2016-04-02 20:29:31 -0400
commit7f911175d41c6fb94744204f72a0dbe2263a2020 (patch)
treea9cfd02596ab383887c4c8d471a28ed553ca2ec2 /src/map/battle.cpp
parent14a87196ed27b1abab6b5357a9938e834699bc59 (diff)
parent9d3dd9aa9e35c9b2592a778da0699dcb8a69b3ff (diff)
downloadtmwa-7f911175d41c6fb94744204f72a0dbe2263a2020.tar.gz
tmwa-7f911175d41c6fb94744204f72a0dbe2263a2020.tar.bz2
tmwa-7f911175d41c6fb94744204f72a0dbe2263a2020.tar.xz
tmwa-7f911175d41c6fb94744204f72a0dbe2263a2020.zip
Merge pull request #195 from wushin/add-nicks-back
add player nicks back to messages
Diffstat (limited to 'src/map/battle.cpp')
-rw-r--r--src/map/battle.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 589568b..991a489 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -182,6 +182,27 @@ int battle_get_max_hp(dumb_ptr<block_list> bl)
}
}
+VString<23> battle_get_name(dumb_ptr<block_list> bl)
+{
+ VString<23> name;
+ nullpo_retr(name, bl);
+
+ switch (bl->bl_type)
+ {
+ case BL::PC:
+ name = bl->is_player()->status_key.name.to__actual();
+ break;
+ case BL::NPC:
+ name = bl->is_npc()->name;
+ break;
+ case BL::MOB:
+ name = bl->is_mob()->name;
+ break;
+ }
+
+ return name;
+}
+
/*==========================================
* 対象のStrを返す(汎用)
* 戻りは整数で0以上