Added null checks for tile destroyed check.
This commit is contained in:
parent
554eb464f1
commit
aa3a491dab
1 changed files with 12 additions and 9 deletions
|
|
@ -199,23 +199,26 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (player != null && player.Active)
|
if (player != null && player.Active)
|
||||||
{
|
{
|
||||||
if (player.TileThreshold >= ConfigurationManager.TileThreshold)
|
if (player.TilesDestroyed != null)
|
||||||
{
|
{
|
||||||
if (Tools.HandleTntUser(player, "Kill tile abuse detected."))
|
if (player.TileThreshold >= ConfigurationManager.TileThreshold)
|
||||||
{
|
{
|
||||||
TSPlayer.Server.RevertKillTile(player.TilesDestroyed);
|
if (Tools.HandleTntUser(player, "Kill tile abuse detected."))
|
||||||
|
{
|
||||||
|
TSPlayer.Server.RevertKillTile(player.TilesDestroyed);
|
||||||
|
}
|
||||||
|
else if (player.TileThreshold > 0)
|
||||||
|
{
|
||||||
|
player.TileThreshold = 0;
|
||||||
|
player.TilesDestroyed.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (player.TileThreshold > 0)
|
else if (player.TileThreshold > 0)
|
||||||
{
|
{
|
||||||
player.TileThreshold = 0;
|
player.TileThreshold = 0;
|
||||||
player.TilesDestroyed.Clear();
|
player.TilesDestroyed.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else if (player.TileThreshold > 0)
|
|
||||||
{
|
|
||||||
player.TileThreshold = 0;
|
|
||||||
player.TilesDestroyed.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player.Group.HasPermission("usebanneditem"))
|
if (!player.Group.HasPermission("usebanneditem"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue