Skip to content

Commit

Permalink
Actually register the command
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodlyay committed Sep 26, 2023
1 parent d39f259 commit 17b9f6b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions CustomModels/CustomModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 17b9f6b

Please sign in to comment.