OnKillMe now uses GetDataHandledEventArgs.
This commit is contained in:
parent
0543e0b18f
commit
649cd453d7
1 changed files with 4 additions and 5 deletions
|
|
@ -451,10 +451,8 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a KillMe event
|
/// For use in a KillMe event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class KillMeEventArgs : HandledEventArgs
|
public class KillMeEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>The TSPlayer that triggered the event.</summary>
|
|
||||||
public TSPlayer Player { get; set; }
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria playerID of the player
|
/// The Terraria playerID of the player
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -479,7 +477,7 @@ namespace TShockAPI
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<KillMeEventArgs> KillMe = new HandlerList<KillMeEventArgs>();
|
public static HandlerList<KillMeEventArgs> KillMe = new HandlerList<KillMeEventArgs>();
|
||||||
|
|
||||||
private static bool OnKillMe(TSPlayer player, byte plr, byte direction, short damage, bool pvp, PlayerDeathReason playerDeathReason)
|
private static bool OnKillMe(TSPlayer player, MemoryStream data, byte plr, byte direction, short damage, bool pvp, PlayerDeathReason playerDeathReason)
|
||||||
{
|
{
|
||||||
if (KillMe == null)
|
if (KillMe == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -487,6 +485,7 @@ namespace TShockAPI
|
||||||
var args = new KillMeEventArgs
|
var args = new KillMeEventArgs
|
||||||
{
|
{
|
||||||
Player = player,
|
Player = player,
|
||||||
|
Data = data,
|
||||||
PlayerId = plr,
|
PlayerId = plr,
|
||||||
Direction = direction,
|
Direction = direction,
|
||||||
Damage = damage,
|
Damage = damage,
|
||||||
|
|
@ -2433,7 +2432,7 @@ namespace TShockAPI
|
||||||
BitsByte bits = (BitsByte)args.Data.ReadByte();
|
BitsByte bits = (BitsByte)args.Data.ReadByte();
|
||||||
bool pvp = bits[0];
|
bool pvp = bits[0];
|
||||||
|
|
||||||
if (OnKillMe(args.Player, id, direction, dmg, pvp, playerDeathReason))
|
if (OnKillMe(args.Player, args.Data, id, direction, dmg, pvp, playerDeathReason))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
args.Player.Dead = true;
|
args.Player.Dead = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue