From 4480a508b316644ad9f4c55a68b8b81a3665b3c5 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 25 May 2010 03:53:13 +0000 Subject: [PATCH] - Changed AActor::GetTag() to use language lookups for strings that start with $. SVN r2337 (trunk) --- src/p_mobj.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 2e85dfc68..f12180ff8 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -60,6 +60,7 @@ #include "colormatcher.h" #include "v_palette.h" #include "p_enemy.h" +#include "gstrings.h" // MACROS ------------------------------------------------------------------ @@ -5561,9 +5562,26 @@ bool AActor::IsSentient() const const char *AActor::GetTag(const char *def) const { - if (Tag != NAME_None) return Tag.GetChars(); - else if (def) return def; - else return GetClass()->TypeName.GetChars(); + if (Tag != NAME_None) + { + 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(); + } }