Add GetCharacterName() to retrieve an NPC's name as defined in its dialogue script, if it exists. Otherwise it will just return the same output as GetTag().
This commit is contained in:
parent
45c1cc8c08
commit
b28e5cb917
4 changed files with 28 additions and 0 deletions
|
|
@ -7399,6 +7399,19 @@ void AActor::SetTag(const char *def)
|
|||
else Tag = mStringPropertyData.Alloc(def);
|
||||
}
|
||||
|
||||
const char *AActor::GetCharacterName() const
|
||||
{
|
||||
if (Conversation && Conversation->SpeakerName.Len() != 0)
|
||||
{
|
||||
const char *cname = Conversation->SpeakerName.GetChars();
|
||||
if (cname[0] == '$')
|
||||
{
|
||||
return GStrings(cname + 1);
|
||||
}
|
||||
else return cname;
|
||||
}
|
||||
return GetTag();
|
||||
}
|
||||
|
||||
void AActor::ClearCounters()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue