- use FSharedStringArena to handle AActor's tag strings properly. They were names before which are not case sensitive and could cause problems.

- fixed FSharedStringArena::FreeAll did not NULL TopBlock.
- bumped savegame version for above changes.


SVN r3100 (trunk)
This commit is contained in:
Christoph Oelckers 2011-01-12 00:17:13 +00:00
commit 789c937635
7 changed files with 41 additions and 7 deletions

View file

@ -300,7 +300,6 @@ void AActor::Serialize (FArchive &arc)
<< pushfactor
<< Species
<< Score
<< Tag
<< lastpush << lastbump
<< PainThreshold
<< DamageFactor
@ -309,6 +308,17 @@ void AActor::Serialize (FArchive &arc)
<< PoisonDamage << PoisonDuration << PoisonPeriod
<< ConversationRoot << Conversation;
{
FString tagstr;
if (arc.IsStoring() && Tag != NULL && Tag->Len() > 0) tagstr = *Tag;
arc << tagstr;
if (arc.IsLoading())
{
if (tagstr.Len() == 0) Tag = NULL;
else Tag = mStringPropertyData.Alloc(tagstr);
}
}
if (arc.IsLoading ())
{
touching_sectorlist = NULL;
@ -5521,11 +5531,13 @@ bool AActor::IsSentient() const
}
FSharedStringArena AActor::mStringPropertyData;
const char *AActor::GetTag(const char *def) const
{
if (Tag != NAME_None)
if (Tag != NULL)
{
const char *tag = Tag.GetChars();
const char *tag = Tag->GetChars();
if (tag[0] == '$')
{
return GStrings(tag + 1);
@ -5545,6 +5557,18 @@ const char *AActor::GetTag(const char *def) const
}
}
void AActor::SetTag(const char *def)
{
if (def == NULL || *def == 0)
{
Tag = NULL;
}
else
{
Tag = mStringPropertyData.Alloc(def);
}
}
void AActor::ClearCounters()
{