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:
parent
4fa0f888ea
commit
3a59280834
2 changed files with 36 additions and 36 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue