- Changed AActor::GetTag() to use language lookups for strings that start with $.

SVN r2337 (trunk)
This commit is contained in:
Randy Heit 2010-05-25 03:53:13 +00:00
parent 709414e606
commit 4480a508b3

View file

@ -60,6 +60,7 @@
#include "colormatcher.h" #include "colormatcher.h"
#include "v_palette.h" #include "v_palette.h"
#include "p_enemy.h" #include "p_enemy.h"
#include "gstrings.h"
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
@ -5561,9 +5562,26 @@ bool AActor::IsSentient() const
const char *AActor::GetTag(const char *def) const const char *AActor::GetTag(const char *def) const
{ {
if (Tag != NAME_None) return Tag.GetChars(); if (Tag != NAME_None)
else if (def) return def; {
else return GetClass()->TypeName.GetChars(); const char *tag = Tag.GetChars();
if (tag[0] == '$')
{
return GStrings(tag + 1);
}
else
{
return tag;
}
}
else if (def)
{
return def;
}
else
{
return GetClass()->TypeName.GetChars();
}
} }