OnPlayerTeam now uses GetDataHandledEventArgs.
This commit is contained in:
parent
62013c7594
commit
3f9c0ebbfe
1 changed files with 5 additions and 3 deletions
|
|
@ -173,7 +173,7 @@ namespace TShockAPI
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// For use in a PlayerTeam event
|
/// For use in a PlayerTeam event
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class PlayerTeamEventArgs : HandledEventArgs
|
public class PlayerTeamEventArgs : GetDataHandledEventArgs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Terraria player ID of the player
|
/// The Terraria player ID of the player
|
||||||
|
|
@ -188,13 +188,15 @@ namespace TShockAPI
|
||||||
/// TogglePvp - called when a player toggles pvp
|
/// TogglePvp - called when a player toggles pvp
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static HandlerList<PlayerTeamEventArgs> PlayerTeam = new HandlerList<PlayerTeamEventArgs>();
|
public static HandlerList<PlayerTeamEventArgs> PlayerTeam = new HandlerList<PlayerTeamEventArgs>();
|
||||||
private static bool OnPlayerTeam(byte _id, byte _team)
|
private static bool OnPlayerTeam(TSPlayer player, MemoryStream data, byte _id, byte _team)
|
||||||
{
|
{
|
||||||
if (PlayerTeam == null)
|
if (PlayerTeam == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var args = new PlayerTeamEventArgs
|
var args = new PlayerTeamEventArgs
|
||||||
{
|
{
|
||||||
|
Player = player,
|
||||||
|
Data = data,
|
||||||
PlayerId = _id,
|
PlayerId = _id,
|
||||||
Team = _team,
|
Team = _team,
|
||||||
};
|
};
|
||||||
|
|
@ -2201,7 +2203,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
byte id = args.Data.ReadInt8();
|
byte id = args.Data.ReadInt8();
|
||||||
byte team = args.Data.ReadInt8();
|
byte team = args.Data.ReadInt8();
|
||||||
if (OnPlayerTeam(id, team))
|
if (OnPlayerTeam(args.Player, args.Data, id, team))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (id != args.Player.Index)
|
if (id != args.Player.Index)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue