- moved the FRenderer::StateChanged call from AActor::StaticSpawn to AActor::PostBeginPlay.

- ensured that all classes reach AActor's PostBeginPlay method. Some were missing a Super call.


SVN r3404 (trunk)
This commit is contained in:
Christoph Oelckers 2012-03-07 01:03:56 +00:00
parent f2f9bd800d
commit d3981197c5
4 changed files with 8 additions and 5 deletions

View File

@ -102,6 +102,7 @@ class ARandomSpawner : public AActor
{
AActor * newmobj = NULL;
bool boss = false;
Super::PostBeginPlay();
if (Species == NAME_None) { Destroy(); return; }
const PClass * cls = PClass::FindClass(Species);
if (this->flags & MF_MISSILE && target && target->target) // Attempting to spawn a missile.

View File

@ -531,7 +531,7 @@ bool AActor::SetState (FState *newstate, bool nofunction)
newstate = newstate->GetNextState();
} while (tics == 0);
if (screen != NULL)
if (Renderer != NULL)
{
Renderer->StateChanged(this);
}
@ -3661,10 +3661,6 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
{
level.total_secrets++;
}
if (screen != NULL)
{
Renderer->StateChanged(actor);
}
return actor;
}
@ -3757,6 +3753,10 @@ void AActor::BeginPlay ()
void AActor::PostBeginPlay ()
{
if (Renderer != NULL)
{
Renderer->StateChanged(this);
}
PrevAngle = angle;
}

View File

@ -532,6 +532,7 @@ void APlayerPawn::Tick()
void APlayerPawn::PostBeginPlay()
{
Super::PostBeginPlay();
SetupWeaponSlots();
// Voodoo dolls: restore original floorz/ceilingz logic

View File

@ -2297,6 +2297,7 @@ void AMusicChanger::PostBeginPlay()
{
// The music changer should consider itself activated if the player
// spawns in its sector as well as if it enters the sector during a P_TryMove.
Super::PostBeginPlay();
if (players[consoleplayer].mo && players[consoleplayer].mo->Sector == this->Sector)
{
TriggerAction(players[consoleplayer].mo, SECSPAC_Enter);