From 17b9f6b080013bc0bbed3064178e209ff456c109 Mon Sep 17 00:00:00 2001 From: Goodlyay Date: Tue, 26 Sep 2023 11:16:37 -0700 Subject: [PATCH] Actually register the command --- CustomModels/CustomModels.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/CustomModels/CustomModels.cs b/CustomModels/CustomModels.cs index b65341c..9956606 100644 --- a/CustomModels/CustomModels.cs +++ b/CustomModels/CustomModels.cs @@ -120,10 +120,9 @@ static int CheckFolder(string folderPath) { //------------------------------------------------------------------ plugin interface internal static PlayerList bypassMaxSize; - CmdCustomModel command = null; + Command[] commands = new Command[] { new CmdCustomModel(), new CmdBypassModelSizeLimit() }; public override void Load(bool startup) { - command = new CmdCustomModel(); - Command.Register(command); + foreach (Command cmd in commands) { Command.Register(cmd); } OnPlayerFinishConnectingEvent.Register(OnPlayerFinishConnecting, Priority.Low); OnPlayerDisconnectEvent.Register(OnPlayerDisconnect, Priority.Low); @@ -166,10 +165,7 @@ public override void Unload(bool shutdown) { OnPlayerCommandEvent.Unregister(OnPlayerCommand); // OnEntitySpawnedEvent.Unregister(OnEntitySpawned); - if (command != null) { - Command.Unregister(command); - command = null; - } + foreach (Command cmd in commands) { Command.Unregister(cmd); } } } // class CustomModelsPlugin