Added a config option for preventing world modification when dead
Closes #437
This commit is contained in:
parent
9648fe1060
commit
2537da2346
2 changed files with 9 additions and 0 deletions
|
|
@ -230,6 +230,9 @@ namespace TShockAPI
|
||||||
|
|
||||||
[Description("Prevent banks on SSI")] public bool DisablePiggybanksOnSSI = false;
|
[Description("Prevent banks on SSI")] public bool DisablePiggybanksOnSSI = false;
|
||||||
|
|
||||||
|
[Description("Prevent players from interacting with the world if dead")] public bool PreventDeadModification =
|
||||||
|
false;
|
||||||
|
|
||||||
public static ConfigFile Read(string path)
|
public static ConfigFile Read(string path)
|
||||||
{
|
{
|
||||||
if (!File.Exists(path))
|
if (!File.Exists(path))
|
||||||
|
|
|
||||||
|
|
@ -1649,6 +1649,9 @@ namespace TShockAPI
|
||||||
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (args.Player.Dead && TShock.Config.PreventDeadModification)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (args.Player.AwaitingName)
|
if (args.Player.AwaitingName)
|
||||||
{
|
{
|
||||||
var protectedregions = TShock.Regions.InAreaRegionName(tileX, tileY);
|
var protectedregions = TShock.Regions.InAreaRegionName(tileX, tileY);
|
||||||
|
|
@ -2221,6 +2224,9 @@ namespace TShockAPI
|
||||||
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (args.Player.Dead && TShock.Config.PreventDeadModification)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (TShock.CheckIgnores(args.Player))
|
if (TShock.CheckIgnores(args.Player))
|
||||||
{
|
{
|
||||||
args.Player.SendTileSquare(tileX, tileY);
|
args.Player.SendTileSquare(tileX, tileY);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue