From 26a5b00567a53bb91d59db8c9e4357bd16a42d0b Mon Sep 17 00:00:00 2001 From: White Date: Tue, 21 Feb 2017 22:21:28 +1030 Subject: [PATCH] Updated Utils.HasBanExpired to use new Ban fields --- TShockAPI/Utils.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/TShockAPI/Utils.cs b/TShockAPI/Utils.cs index 381ea202..ab275b29 100644 --- a/TShockAPI/Utils.cs +++ b/TShockAPI/Utils.cs @@ -672,10 +672,7 @@ namespace TShockAPI /// bool - True if the ban has expired. public bool HasBanExpired(Ban ban, bool byName = false) { - DateTime exp; - bool expirationExists = DateTime.TryParse(ban.Expiration, out exp); - - if (!string.IsNullOrWhiteSpace(ban.Expiration) && (expirationExists) && (DateTime.UtcNow >= exp)) + if (!string.IsNullOrWhiteSpace(ban.Expiration) && (ban.ExpirationDateTime != null) && (DateTime.UtcNow >= ban.ExpirationDateTime)) { if (byName) {