OnTeleport now uses GetDataHandledEventArgs.
This commit is contained in:
parent
1ff2d6566b
commit
6814aabf6e
1 changed files with 5 additions and 3 deletions
|
|
@ -1430,7 +1430,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use with a NPCStrike event
|
/// For use with a NPCStrike event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TeleportEventArgs : HandledEventArgs
|
public class TeleportEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ???
|
/// ???
|
||||||
|
|
@ -1458,13 +1458,15 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<TeleportEventArgs> Teleport = new HandlerList<TeleportEventArgs>();
|
public static HandlerList<TeleportEventArgs> Teleport = new HandlerList<TeleportEventArgs>();
|
||||||
|
|
||||||
private static bool OnTeleport(Int16 id, byte f, float x, float y)
|
private static bool OnTeleport(TSPlayer player, MemoryStream data, Int16 id, byte f, float x, float y)
|
||||||
{
|
{
|
||||||
if (Teleport == null)
|
if (Teleport == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new TeleportEventArgs
|
var args = new TeleportEventArgs
|
||||||
{
|
{
|
||||||
|
Player = player,
|
||||||
|
Data = data,
|
||||||
ID = id,
|
ID = id,
|
||||||
Flag = f,
|
Flag = f,
|
||||||
X = x,
|
X = x,
|
||||||
|
|
@ -2988,7 +2990,7 @@ namespace TShockAPI
|
||||||
var x = args.Data.ReadSingle();
|
var x = args.Data.ReadSingle();
|
||||||
var y = args.Data.ReadSingle();
|
var y = args.Data.ReadSingle();
|
||||||
|
|
||||||
if (OnTeleport(id, flag, x, y))
|
if (OnTeleport(args.Player, args.Data, id, flag, x, y))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
int type = 0;
|
int type = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue