- scriptified the sector silencer.

This commit is contained in:
Christoph Oelckers 2017-01-12 23:35:24 +01:00
parent 3d73919092
commit cc58f13e4e
2 changed files with 16 additions and 28 deletions

View File

@ -150,30 +150,3 @@ void AStackPoint::BeginPlay ()
AActor::BeginPlay ();
}
//---------------------------------------------------------------------------
class ASectorSilencer : public AActor
{
DECLARE_CLASS (ASectorSilencer, AActor)
public:
void BeginPlay ();
void OnDestroy() override;
};
IMPLEMENT_CLASS(ASectorSilencer, false, false)
void ASectorSilencer::BeginPlay ()
{
Super::BeginPlay ();
Sector->Flags |= SECF_SILENT;
}
void ASectorSilencer::OnDestroy ()
{
if (Sector != nullptr)
{
Sector->Flags &= ~SECF_SILENT;
}
Super::OnDestroy();
}

View File

@ -37,7 +37,7 @@ class LowerStackLookOnly : StackPoint
}
class SectorSilencer native
class SectorSilencer : Actor
{
default
{
@ -46,4 +46,19 @@ class SectorSilencer native
+DONTSPLASH
RenderStyle "None";
}
override void BeginPlay ()
{
Super.BeginPlay ();
CurSector.Flags |= Sector.SECF_SILENT;
}
override void OnDestroy ()
{
if (CurSector != null)
{
CurSector.Flags &= ~Sector.SECF_SILENT;
}
Super.OnDestroy();
}
}