mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- 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:
parent
1b741775a4
commit
a8ba2a99ea
5 changed files with 26 additions and 8 deletions
|
@ -1,4 +1,8 @@
|
|||
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
|
||||
with an FString now.
|
||||
- Fixed: The music strings in the default level info were never freed and
|
||||
|
|
|
@ -743,7 +743,7 @@ public:
|
|||
FState *FindState (FName label) const;
|
||||
FState *FindState (int numnames, int first, ...) const;
|
||||
FState *FindState (int numnames, va_list arglist) const;
|
||||
bool HasStates (FName label) const;
|
||||
bool HasSpecialDeathStates () const;
|
||||
|
||||
static FState States[];
|
||||
|
||||
|
|
24
src/info.cpp
24
src/info.cpp
|
@ -453,23 +453,37 @@ FState *AActor::FindState (FName label) const
|
|||
//
|
||||
// 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;
|
||||
FStateLabel *slabel;
|
||||
TArray<FName> checkedTypes;
|
||||
|
||||
while (info != NULL)
|
||||
{
|
||||
if (info->StateList != NULL)
|
||||
{
|
||||
slabel = info->StateList->FindLabel (label);
|
||||
if (slabel != NULL)
|
||||
slabel = info->StateList->FindLabel (NAME_Death);
|
||||
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;
|
||||
|
|
|
@ -4923,7 +4923,7 @@ int DLevelScript::RunScript ()
|
|||
case PCD_SETACTORPITCH:
|
||||
if (STACK(2) == 0)
|
||||
{
|
||||
activator->angle = STACK(1) << 16;
|
||||
activator->pitch = STACK(1) << 16;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -4639,7 +4639,7 @@ int AActor::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FN
|
|||
// it needs to work.
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue