diff --git a/TShockAPI/Hooks/RegionHooks.cs b/TShockAPI/Hooks/RegionHooks.cs index aacde375..1f195925 100644 --- a/TShockAPI/Hooks/RegionHooks.cs +++ b/TShockAPI/Hooks/RegionHooks.cs @@ -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 diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 49b1f6e7..1c8177a7 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -826,7 +826,7 @@ namespace TShockAPI { if (oldRegion != null) { - Hooks.RegionHooks.OnRegionLeft(player); + Hooks.RegionHooks.OnRegionLeft(player, oldRegion); } if (player.CurrentRegion != null)