Added a config option for preventing world modification when dead

Closes #437
This commit is contained in:
Lucas Nicodemus 2012-05-26 03:46:11 -06:00
parent 9648fe1060
commit 2537da2346
2 changed files with 9 additions and 0 deletions

View file

@ -230,6 +230,9 @@ namespace TShockAPI
[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)
{
if (!File.Exists(path))

View file

@ -1649,6 +1649,9 @@ namespace TShockAPI
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
return false;
if (args.Player.Dead && TShock.Config.PreventDeadModification)
return true;
if (args.Player.AwaitingName)
{
var protectedregions = TShock.Regions.InAreaRegionName(tileX, tileY);
@ -2221,6 +2224,9 @@ namespace TShockAPI
if (tileX < 0 || tileX >= Main.maxTilesX || tileY < 0 || tileY >= Main.maxTilesY)
return false;
if (args.Player.Dead && TShock.Config.PreventDeadModification)
return true;
if (TShock.CheckIgnores(args.Player))
{
args.Player.SendTileSquare(tileX, tileY);