- replaced more dyn_casts and checks for RUNTIME_CLASS(PClassActor)
It is preferable to use IsDescendantOf wherever possible if we ever want to be able to separate PClass from PType.
This commit is contained in:
parent
5350721ec5
commit
9c9b2ccf6d
13 changed files with 28 additions and 23 deletions
11
src/actor.h
11
src/actor.h
|
|
@ -1572,6 +1572,17 @@ template<class T> inline T *Spawn() // for inventory items we do not need coordi
|
|||
return static_cast<T *>(AActor::StaticSpawn(RUNTIME_TEMPLATE_CLASS(T), DVector3(0, 0, 0), NO_REPLACE));
|
||||
}
|
||||
|
||||
inline PClassActor *PClass::FindActor(FName name)
|
||||
{
|
||||
auto cls = FindClass(name);
|
||||
return cls && cls->IsDescendantOf(RUNTIME_CLASS(AActor)) ? static_cast<PClassActor*>(cls) : nullptr;
|
||||
}
|
||||
|
||||
inline PClassActor *ValidateActor(PClass *cls)
|
||||
{
|
||||
return cls && cls->IsDescendantOf(RUNTIME_CLASS(AActor)) ? static_cast<PClassActor*>(cls) : nullptr;
|
||||
}
|
||||
|
||||
void PrintMiscActorInfo(AActor * query);
|
||||
AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, ActorFlags actorMask, uint32_t wallMask);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue