diff --git a/EXILED.props b/EXILED.props index ecc92bf069..bc15d2e7d5 100644 --- a/EXILED.props +++ b/EXILED.props @@ -15,7 +15,7 @@ - 9.0.0-alpha.19 + 9.0.0-beta.1 false diff --git a/Exiled.API/Features/Core/EActor.cs b/Exiled.API/Features/Core/EActor.cs index 87723416c1..7d8b7fe023 100644 --- a/Exiled.API/Features/Core/EActor.cs +++ b/Exiled.API/Features/Core/EActor.cs @@ -481,7 +481,6 @@ protected virtual void PostInitialize() /// protected virtual void OnBeginPlay() { - SubscribeEvents(); } /// diff --git a/Exiled.API/Features/Core/EObject.cs b/Exiled.API/Features/Core/EObject.cs index efa17eb96a..a0af7ac800 100644 --- a/Exiled.API/Features/Core/EObject.cs +++ b/Exiled.API/Features/Core/EObject.cs @@ -918,4 +918,4 @@ protected virtual void OnDestroyed() { } } -} +} \ No newline at end of file diff --git a/Exiled.API/Features/Core/GameEntity.cs b/Exiled.API/Features/Core/GameEntity.cs index 41be51dcd7..aa84602d36 100644 --- a/Exiled.API/Features/Core/GameEntity.cs +++ b/Exiled.API/Features/Core/GameEntity.cs @@ -163,7 +163,6 @@ public T AddComponent(string name = "") public EActor AddComponent(Type type, string name = "") { EActor component = EObject.CreateDefaultSubobject(type, GameObject).Cast(); - component.Base = GameObject; if (!component) return null; diff --git a/Exiled.API/Features/Core/Generic/EBehaviour.cs b/Exiled.API/Features/Core/Generic/EBehaviour.cs index dd5553a8a4..a2b3fd611e 100644 --- a/Exiled.API/Features/Core/Generic/EBehaviour.cs +++ b/Exiled.API/Features/Core/Generic/EBehaviour.cs @@ -25,6 +25,13 @@ namespace Exiled.API.Features.Core.Generic public abstract class EBehaviour : EActor where T : GameEntity { + /// + /// Initializes a new instance of the class. + /// + protected EBehaviour() + { + } + /// /// Gets or sets the owner of the . /// @@ -78,6 +85,12 @@ protected override void PostInitialize() } } + /// + protected override void OnBeginPlay() + { + base.OnBeginPlay(); + } + /// protected override void Tick() { diff --git a/Exiled.CustomModules/API/Features/CustomModule.cs b/Exiled.CustomModules/API/Features/CustomModule.cs index b0a936bde8..1946cf8647 100644 --- a/Exiled.CustomModules/API/Features/CustomModule.cs +++ b/Exiled.CustomModules/API/Features/CustomModule.cs @@ -318,9 +318,7 @@ public static void LoadAll() /// Determines whether the loaded modules should be enabled after loading. public static void Load(Assembly assembly = null, bool shouldBeEnabled = false) { - Log.InfoWithContext($"Using defined assembly? {assembly is null}"); assembly ??= Assembly.GetCallingAssembly(); - Log.InfoWithContext($"{assembly.GetName().Name}"); UUModuleType FindClosestModuleType(Type t, IEnumerable source) { @@ -331,7 +329,6 @@ UUModuleType FindClosestModuleType(Type t, IEnumerable source) Type runtime_ModuleType = assembly.GetTypes().FirstOrDefault(t => !t.IsAbstract && typeof(UUModuleType).IsAssignableFrom(t)) ?? typeof(UUModuleType); IEnumerable moduleTypeValuesInfo = runtime_ModuleType.GetFields(BindingFlags.Static | BindingFlags.Public).Where(f => f.GetValue(null) is UUModuleType); - Log.InfoWithContext($"DB1"); foreach (Type type in assembly.GetTypes()) { diff --git a/Exiled.CustomModules/API/Features/CustomRoles/RoleBehaviour.cs b/Exiled.CustomModules/API/Features/CustomRoles/RoleBehaviour.cs index 5f640b87d2..0f63d1b34b 100644 --- a/Exiled.CustomModules/API/Features/CustomRoles/RoleBehaviour.cs +++ b/Exiled.CustomModules/API/Features/CustomRoles/RoleBehaviour.cs @@ -355,9 +355,9 @@ protected override void PostInitialize() protected override void OnBeginPlay() { base.OnBeginPlay(); - if (!Owner) { + Log.WarnWithContext("Owner is null"); Destroy(); return; } @@ -369,6 +369,8 @@ protected override void OnBeginPlay() Owner.ChangeAppearance(FakeAppearance, false); PermanentEffects?.ForEach(x => Owner.SyncEffect(x)); + + SubscribeEvents(); } /// @@ -450,9 +452,6 @@ protected override void SubscribeEvents() { base.SubscribeEvents(); - EscapingEventDispatcher.Bind(this, OnEscaping); - EscapedEventDispatcher.Bind(this, OnEscaped); - Exiled.Events.Handlers.Player.ChangingItem += ChangingItemBehaviour; Exiled.Events.Handlers.Player.Destroying += DestroyOnLeave; Exiled.Events.Handlers.Player.ChangingRole += DestroyOnChangingRole; @@ -474,6 +473,8 @@ protected override void SubscribeEvents() Exiled.Events.Handlers.Player.Handcuffing += HandcuffingBehavior; Exiled.Events.Handlers.Map.PlacingBlood += PlacingBloodBehavior; Exiled.Events.Handlers.Player.ChangingNickname += OnInternalChangingNickname; + EscapingEventDispatcher.Bind(this, OnEscaping); + EscapedEventDispatcher.Bind(this, OnEscaped); } /// @@ -759,21 +760,8 @@ protected virtual void PlacingBloodBehavior(PlacingBloodEventArgs ev) /// protected virtual void DroppingItemBehavior(DroppingItemEventArgs ev) { - if (ev.Item is null) - { - Log.Error("Item is null"); - } - - Log.InfoWithContext($"{ev.Player} is trying to drop {ev.Item.Type}"); - - Log.WarnWithContext(Settings.CanDropItems); if (!Check(ev.Player) || Settings.CanDropItems) - { - Log.InfoWithContext($"{ev.Player} is not {CustomRole.Name} or can drop items as {CustomRole.Name}"); return; - } - - Log.InfoWithContext($"{ev.Player} cannot drop items"); ev.IsAllowed = false; }