Added null checks for tile destroyed check.

This commit is contained in:
Deathmax 2011-06-28 17:09:58 +08:00
parent 554eb464f1
commit aa3a491dab

View file

@ -198,6 +198,8 @@ namespace TShockAPI
foreach (TSPlayer player in TShock.Players) foreach (TSPlayer player in TShock.Players)
{ {
if (player != null && player.Active) if (player != null && player.Active)
{
if (player.TilesDestroyed != null)
{ {
if (player.TileThreshold >= ConfigurationManager.TileThreshold) if (player.TileThreshold >= ConfigurationManager.TileThreshold)
{ {
@ -217,6 +219,7 @@ namespace TShockAPI
player.TileThreshold = 0; player.TileThreshold = 0;
player.TilesDestroyed.Clear(); player.TilesDestroyed.Clear();
} }
}
if (!player.Group.HasPermission("usebanneditem")) if (!player.Group.HasPermission("usebanneditem"))
{ {