- Merged FActorInfo::FindStateExact and FActorInfo::FindState into one function

because the differences are only minimal.
- Removed all the varargs FindState functions because they aren't really needed.
  The engine itself never explicitly checks for more than 2 labels and for the 
  rest a function that gets passed a FName array is more suitable anyway.


SVN r414 (trunk)
This commit is contained in:
Christoph Oelckers 2006-12-16 14:06:21 +00:00
commit 693bf96cb3
11 changed files with 89 additions and 126 deletions

View file

@ -1014,7 +1014,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
if (target != NULL && target->flags & (MF_SHOOTABLE|MF_CORPSE))
{
if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash);
if (nextstate == NULL) nextstate = mo->FindState(2, NAME_Death, NAME_Extreme);
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death, NAME_Extreme);
}
if (nextstate == NULL) nextstate = mo->FindState(NAME_Death);
mo->SetState (nextstate);
@ -4711,7 +4711,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
target = source;
if (pr_takedamage() < PainChance)
{
FState * painstate = FindState(2,NAME_Pain, (int)damagetype);
FState * painstate = FindState(NAME_Pain, damagetype);
if (painstate != NULL) SetState (painstate);
}
return -1;
@ -4729,7 +4729,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
}
if (damagetype == NAME_Ice)
{
death = GetClass()->ActorInfo->FindStateExact (2, NAME_Death, NAME_Ice);
death = FindState (NAME_Death, NAME_Ice, true);
if (death == NULL && !deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) &&
(player || (flags3 & MF3_ISMONSTER)))
{
@ -4738,7 +4738,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
}
else
{
death = FindState (2, NAME_Death, int(damagetype));
death = FindState (NAME_Death, damagetype);
}
return (death == NULL) ? -1 : damage;
}
@ -4753,7 +4753,7 @@ void AActor::Crash()
if (DamageType != NAME_None)
{
crashstate = GetClass()->ActorInfo->FindStateExact(2, NAME_Crash, int(DamageType));
crashstate = FindState(NAME_Crash, DamageType, true);
}
if (crashstate == NULL)
{
@ -4762,7 +4762,7 @@ void AActor::Crash()
if (health<gibhealth)
{ // Extreme death
crashstate = FindState (2, NAME_Crash, NAME_Extreme);
crashstate = FindState (NAME_Crash, NAME_Extreme);
}
else
{ // Normal death