- Fixed: SetActorPitch with a 0-tid (i.e. affect the activator) set the angle

instead of the pitch.
- Fixed: The check for special death states in AActor::TakeSpecialDamage didn't
  work.


SVN r371 (trunk)
This commit is contained in:
Christoph Oelckers 2006-10-31 21:49:45 +00:00
parent 1b741775a4
commit a8ba2a99ea
5 changed files with 26 additions and 8 deletions

View file

@ -1,4 +1,8 @@
October 31, 2006 (Changes by Graf Zahl) October 31, 2006 (Changes by Graf Zahl)
- Fixed: SetActorPitch with a 0-tid (i.e. affect the activator) set the angle
instead of the pitch.
- Fixed: The check for special death states in AActor::TakeSpecialDamage didn't
work.
- Fixed: The global WeaponSection string was never freed. It has been replaced - Fixed: The global WeaponSection string was never freed. It has been replaced
with an FString now. with an FString now.
- Fixed: The music strings in the default level info were never freed and - Fixed: The music strings in the default level info were never freed and

View file

@ -743,7 +743,7 @@ public:
FState *FindState (FName label) const; FState *FindState (FName label) const;
FState *FindState (int numnames, int first, ...) const; FState *FindState (int numnames, int first, ...) const;
FState *FindState (int numnames, va_list arglist) const; FState *FindState (int numnames, va_list arglist) const;
bool HasStates (FName label) const; bool HasSpecialDeathStates () const;
static FState States[]; static FState States[];

View file

@ -453,23 +453,37 @@ FState *AActor::FindState (FName label) const
// //
// HasStates // HasStates
// //
// Checks whether the actor has substates for the given name. // Checks whether the actor has special death states.
// //
//=========================================================================== //===========================================================================
bool AActor::HasStates (FName label) const bool AActor::HasSpecialDeathStates () const
{ {
const FActorInfo *info = GetClass()->ActorInfo; const FActorInfo *info = GetClass()->ActorInfo;
FStateLabel *slabel; FStateLabel *slabel;
TArray<FName> checkedTypes;
while (info != NULL) while (info != NULL)
{ {
if (info->StateList != NULL) if (info->StateList != NULL)
{ {
slabel = info->StateList->FindLabel (label); slabel = info->StateList->FindLabel (NAME_Death);
if (slabel != NULL) if (slabel != NULL && slabel->Children != NULL)
{ {
return true; for(int i=0;i<slabel->Children->NumLabels;i++)
{
unsigned int j;
for(j=0;j<checkedTypes.Size();j++)
{
if (slabel->Children->Labels[i].Label == checkedTypes[j]) break;
}
// Only check if this damage type hasn't been checked by another class with higher priority.
if (j==checkedTypes.Size())
{
if (slabel->Children->Labels[i].State != NULL) return true;
else if (slabel->Children->Labels[i].valid) checkedTypes.Push(slabel->Children->Labels[i].Label);
}
}
} }
} }
info = info->Class->ParentClass->ActorInfo; info = info->Class->ParentClass->ActorInfo;

View file

@ -4923,7 +4923,7 @@ int DLevelScript::RunScript ()
case PCD_SETACTORPITCH: case PCD_SETACTORPITCH:
if (STACK(2) == 0) if (STACK(2) == 0)
{ {
activator->angle = STACK(1) << 16; activator->pitch = STACK(1) << 16;
} }
else else
{ {

View file

@ -4639,7 +4639,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
// it needs to work. // it needs to work.
// Always kill if there is a regular death state or no death states at all. // Always kill if there is a regular death state or no death states at all.
if (FindState (NAME_Death) != NULL || !HasStates(NAME_Death)) if (FindState (NAME_Death) != NULL || !HasSpecialDeathStates())
{ {
return damage; return damage;
} }