- removed PClass::DeriveData because it is no longer needed.

- fixed: IsVisibleToPlayer and optimized it a bit more.
- moved SourceLumpName to PClass, so that it can also be used for non-actors (there's a lot of non-Actor classes already.)
- separated the serializer for PClassPointer from PPointer. Even though not doable, a pointer to a class type is something entirely different than a class pointer with a restriction so each should handle its own case.
This commit is contained in:
Christoph Oelckers 2017-04-12 09:55:27 +02:00
commit 5350721ec5
8 changed files with 40 additions and 62 deletions

View file

@ -1605,11 +1605,14 @@ bool AActor::IsVisibleToPlayer() const
(signed)(VisibleToTeam-1) != players[consoleplayer].userinfo.GetTeam() )
return false;
auto &vis = GetInfo()->VisibleToPlayerClass;
if (vis.Size() == 0) return true; // early out for the most common case.
const player_t* pPlayer = players[consoleplayer].camera->player;
if (pPlayer)
{
for(auto cls : GetInfo()->VisibleToPlayerClass)
for(auto cls : vis)
{
if (cls && pPlayer->mo->GetClass()->IsDescendantOf(cls))
{