- got rid of FNameNoInit and made the default constructor of FName non-initializing.

This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
This commit is contained in:
Christoph Oelckers 2018-08-19 01:14:15 +02:00
commit fad406c4c9
47 changed files with 185 additions and 309 deletions

View file

@ -196,7 +196,7 @@ bool AActor::HasSpecialDeathStates () const
TArray<FName> &MakeStateNameList(const char * fname)
{
static TArray<FName> namelist(3);
FName firstpart, secondpart;
FName firstpart = NAME_None, secondpart = NAME_None;
char *c;
// Handle the old names for the existing death states
@ -256,21 +256,19 @@ TArray<FName> &MakeStateNameList(const char * fname)
FState *PClassActor::FindState(int numnames, FName *names, bool exact) const
{
FStateLabels *labels = GetStateLabels();
FState *best = NULL;
FState *best = nullptr;
if (labels != NULL)
if (labels != nullptr)
{
int count = 0;
FStateLabel *slabel = NULL;
FName label;
// Find the best-matching label for this class.
while (labels != NULL && count < numnames)
while (labels != nullptr && count < numnames)
{
label = *names++;
slabel = labels->FindLabel(label);
FName label = *names++;
FStateLabel *slabel = labels->FindLabel(label);
if (slabel != NULL)
if (slabel != nullptr)
{
count++;
labels = slabel->Children;
@ -283,7 +281,7 @@ FState *PClassActor::FindState(int numnames, FName *names, bool exact) const
}
if (count < numnames && exact)
{
return NULL;
return nullptr;
}
}
return best;
@ -411,7 +409,7 @@ FStateDefine *FStateDefinitions::FindStateLabelInList(TArray<FStateDefine> & lis
{
FStateDefine def;
def.Label = name;
def.State = NULL;
def.State = nullptr;
def.DefineFlags = SDF_NEXT;
return &list[list.Push(def)];
}