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