Add the region a player left to OnRegionLeft
This commit is contained in:
parent
fd2a049ef3
commit
adc0f0acfb
2 changed files with 6 additions and 4 deletions
|
|
@ -47,23 +47,25 @@ namespace TShockAPI.Hooks
|
|||
public class RegionLeftEventArgs
|
||||
{
|
||||
public TSPlayer Player { get; private set; }
|
||||
public Region Region { get; private set; }
|
||||
|
||||
public RegionLeftEventArgs(TSPlayer ply)
|
||||
public RegionLeftEventArgs(TSPlayer ply, Region region)
|
||||
{
|
||||
Player = ply;
|
||||
Region = region;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void RegionLeftD(RegionLeftEventArgs args);
|
||||
public static event RegionLeftD RegionLeft;
|
||||
public static void OnRegionLeft(TSPlayer player)
|
||||
public static void OnRegionLeft(TSPlayer player, Region region)
|
||||
{
|
||||
if (RegionLeft == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RegionLeft(new RegionLeftEventArgs(player));
|
||||
RegionLeft(new RegionLeftEventArgs(player, region));
|
||||
}
|
||||
|
||||
public class RegionCreatedEventArgs
|
||||
|
|
|
|||
|
|
@ -826,7 +826,7 @@ namespace TShockAPI
|
|||
{
|
||||
if (oldRegion != null)
|
||||
{
|
||||
Hooks.RegionHooks.OnRegionLeft(player);
|
||||
Hooks.RegionHooks.OnRegionLeft(player, oldRegion);
|
||||
}
|
||||
|
||||
if (player.CurrentRegion != null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue