From 4e07eb6c51b00c3df677696f8658c145e9a0882f Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 14 Apr 2020 01:51:09 +0700 Subject: [PATCH] Fix deprecated `Feature` file after refactoring --- sources/Core/Feature.uc | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/sources/Core/Feature.uc b/sources/Core/Feature.uc index a59eabf..675f962 100644 --- a/sources/Core/Feature.uc +++ b/sources/Core/Feature.uc @@ -68,8 +68,8 @@ public static final function Feature EnableMe() } // Event functions that are called when -public function OnEnabled(){} -public function OnDisabled(){} +protected function OnEnabled(){} +protected function OnDisabled(){} // Set listeners' status private static function SetListenersActiveSatus(bool newStatus) @@ -82,27 +82,15 @@ private static function SetListenersActiveSatus(bool newStatus) } } -// 'OnEnabled' and 'OnDisabled' should be called from functions that -// will be called regardless of whether 'Feature' was created -// with 'ChangeEnabledState' or in some other way. -event PreBeginPlay() +protected function OnCreated() { - super.PreBeginPlay(); - // '!bDeleteMe' means that we will be a singleton instance, - // meaning that we only just got enabled. - if (!bDeleteMe && IsEnabled()) - { - // Block spawning this feature before calling any other events - default.blockSpawning = true; - SetListenersActiveSatus(true); - OnEnabled(); - return; - } + default.blockSpawning = true; + SetListenersActiveSatus(true); + OnEnabled(); } -event Destroyed() +protected function OnDestroyed() { - super.Destroyed(); SetListenersActiveSatus(false); OnDisabled(); }