diff --git a/sources/CoreRealm/LevelCore.uc b/sources/CoreRealm/LevelCore.uc index 1b12850..af0afe4 100644 --- a/sources/CoreRealm/LevelCore.uc +++ b/sources/CoreRealm/LevelCore.uc @@ -53,11 +53,31 @@ var private bool blockSpawning; // `LevelCore` var private LevelCore activeInstance; +var private SimpleSignal onShutdownSignal; + +protected function Constructor() +{ + onShutdownSignal = SimpleSignal(_.memory.Allocate(class'SimpleSignal')); +} + protected function Finalizer() { + _.memory.Free(onShutdownSignal); default.activeInstance = none; } +/** + * Signal that will be emitted when caller level core is shut down. + * + * [Signature] + * void () + */ +/* SIGNAL */ +public final function SimpleSlot OnShutdown(AcediaObject receiver) +{ + return SimpleSlot(onShutdownSignal.NewSlot(receiver)); +} + public static function LevelCore CreateLevelCore(Actor source) { if (GetInstance() != none) return none; @@ -95,6 +115,7 @@ event PreBeginPlay() // Clean up event Destroyed() { + onShutdownSignal.Emit(); if (self == default.activeInstance) { default.activeInstance = none; } diff --git a/sources/ServerLevelCore.uc b/sources/ServerLevelCore.uc index 8f1a11d..a882047 100644 --- a/sources/ServerLevelCore.uc +++ b/sources/ServerLevelCore.uc @@ -18,6 +18,13 @@ */ class ServerLevelCore extends LevelCore; +protected function Constructor() +{ + super.Constructor(); + // TODO: this is hack, needs to be redone later + KF1_HealthComponent(_.kf.health).PresudoConstructor(); +} + public static function LevelCore CreateLevelCore(Actor source) { if (source == none) return none;