From 761ee24b469a28082b61f32c7640174894e9d5b3 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sun, 23 Jun 2024 07:54:00 -0500 Subject: [PATCH] Changes GodTuts (#87) * Changes GodTuts to apply to anybody who is forceclassed/ spawned with no reason. Allows Jailed individuals to stay in GodMode without affecting the greater Tutorial role (assuming plugins are configured to send the correct RoleChangeReasons, which they should because thats correct thing to do in my opinion don't @ me) * prettification and efficiency? --- AdminTools/Config.cs | 2 +- AdminTools/EventHandlers.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AdminTools/Config.cs b/AdminTools/Config.cs index 4e39d26..827f860 100644 --- a/AdminTools/Config.cs +++ b/AdminTools/Config.cs @@ -11,7 +11,7 @@ public class Config : IConfig [Description("Whether or not to show logs used for debugging.")] public bool Debug { get; set; } = false; - [Description("Should Staff be in God Mode when they forceclass to Tutorial?? Default: false")] + [Description("Should Tutorials be in God Mode when Forceclassed? Default: false")] public bool GodTuts { get; set; } = false; [Description("Extending Command use for Getting a player (such as candy command and other parts of AdminTools). View the README on github for more info.")] diff --git a/AdminTools/EventHandlers.cs b/AdminTools/EventHandlers.cs index a6497a0..540f70a 100644 --- a/AdminTools/EventHandlers.cs +++ b/AdminTools/EventHandlers.cs @@ -122,7 +122,7 @@ public void OnTriggeringTesla(TriggeringTeslaEventArgs ev) public void OnChangingRole(ChangingRoleEventArgs ev) { - if (plugin.Config.GodTuts && ev.Player.RemoteAdminAccess && ev.Reason == SpawnReason.ForceClass) + if (plugin.Config.GodTuts && (ev.Reason is SpawnReason.ForceClass or SpawnReason.None)) ev.Player.IsGodModeEnabled = ev.NewRole == RoleTypeId.Tutorial; }