Add hooks for Region creation/deletion. Add hooks for Region Enter/Leave. Add member to TSPlayer displaying current region. Set private setters in AccountHooks.
This commit is contained in:
parent
803aa643c2
commit
406abce30c
6 changed files with 156 additions and 4 deletions
|
|
@ -818,6 +818,22 @@ namespace TShockAPI
|
|||
{
|
||||
player.SetBuff(23, 120); //Cursed
|
||||
}
|
||||
|
||||
var oldRegion = player.CurrentRegion;
|
||||
player.CurrentRegion = Regions.GetTopRegion(Regions.InAreaRegion(player.TileX, player.TileY));
|
||||
|
||||
if (oldRegion != player.CurrentRegion)
|
||||
{
|
||||
if (oldRegion != null)
|
||||
{
|
||||
Hooks.RegionHooks.OnRegionLeft(player);
|
||||
}
|
||||
|
||||
if (player.CurrentRegion != null)
|
||||
{
|
||||
Hooks.RegionHooks.OnRegionEntered(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SetConsoleTitle(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue