Pre-initialize TShock hooks for Register method

Hooks have this fancy .Register method when they're of type
HandlerList<Args> that high made but we never bother to initialize
any of them, so .Register doesn't work because it's null.

This solves that problem by just initializing all handlers. Thus,
.Register works, and thus, you can register hooks with priorities.
This commit is contained in:
Lucas Nicodemus 2017-12-20 12:35:42 -07:00
parent 4fa0f888ea
commit 3a59280834
2 changed files with 36 additions and 36 deletions

View file

@ -258,7 +258,7 @@ namespace Rests
}
[Obsolete("This method will be removed in the next release")]
public static HandlerList<RestRequestEventArgs> RestRequestEvent;
public static HandlerList<RestRequestEventArgs> RestRequestEvent = new HandlerList<RestRequestEventArgs>();
private static bool OnRestRequestCall(RequestEventArgs request)
{