OnNPCSpecial now uses GetDataHandledEventArgs.

This commit is contained in:
Lucas Nicodemus 2017-12-23 15:31:20 -07:00
parent 8413343cbd
commit c607ecfe27

View file

@ -1341,7 +1341,7 @@ namespace TShockAPI
/// <summary> /// <summary>
/// For use with a NPCSpecial event /// For use with a NPCSpecial event
/// </summary> /// </summary>
public class NPCSpecialEventArgs : HandledEventArgs public class NPCSpecialEventArgs : GetDataHandledEventArgs
{ {
/// <summary> /// <summary>
/// ??? /// ???
@ -1357,13 +1357,15 @@ namespace TShockAPI
/// </summary> /// </summary>
public static HandlerList<NPCSpecialEventArgs> NPCSpecial = new HandlerList<NPCSpecialEventArgs>(); public static HandlerList<NPCSpecialEventArgs> NPCSpecial = new HandlerList<NPCSpecialEventArgs>();
private static bool OnNPCSpecial(byte id, byte type) private static bool OnNPCSpecial(TSPlayer player, MemoryStream data, byte id, byte type)
{ {
if (NPCSpecial == null) if (NPCSpecial == null)
return false; return false;
var args = new NPCSpecialEventArgs var args = new NPCSpecialEventArgs
{ {
Player = player,
Data = data,
ID = id, ID = id,
Type = type, Type = type,
}; };
@ -2724,7 +2726,7 @@ namespace TShockAPI
var id = args.Data.ReadInt8(); var id = args.Data.ReadInt8();
var type = args.Data.ReadInt8(); var type = args.Data.ReadInt8();
if (OnNPCSpecial(id, type)) if (OnNPCSpecial(args.Player, args.Data, id, type))
return true; return true;
if (type == 1 && TShock.Config.DisableDungeonGuardian) if (type == 1 && TShock.Config.DisableDungeonGuardian)