From 9a45a9ab808b5d4f136ebe1111d40a9c06545539 Mon Sep 17 00:00:00 2001 From: Zidonuke Date: Tue, 20 Dec 2011 13:33:44 -0500 Subject: [PATCH] Quick fix to buff hack check. --- TShockAPI/GetDataHandlers.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 73c2e849..0f82620f 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -49,18 +49,17 @@ namespace TShockAPI public static class GetDataHandlers { private static Dictionary GetDataHandlerDelegates; - public static bool[] WhitelistBuffs; + public static int[] WhitelistBuffMaxTime; public static void InitGetDataHandler() { #region Blacklists - //Check StatusPvp for whats usable - WhitelistBuffs = new bool[Main.maxBuffs]; - WhitelistBuffs[20] = true; //Poisoned - WhitelistBuffs[0x18] = true; //On Fire - WhitelistBuffs[0x1f] = true; //Confused - WhitelistBuffs[0x27] = true; //Cursed Inferno + WhitelistBuffMaxTime = new int[Main.maxBuffs]; + WhitelistBuffMaxTime[20] = 600; + WhitelistBuffMaxTime[0x18] = 1200; + WhitelistBuffMaxTime[0x1f] = 120; + WhitelistBuffMaxTime[0x27] = 420; #endregion Blacklists @@ -82,7 +81,7 @@ namespace TShockAPI {PacketTypes.SignNew, HandleSign}, {PacketTypes.PlayerSlot, HandlePlayerSlot}, {PacketTypes.TileGetSection, HandleGetSection}, - {PacketTypes.UpdateNPCHome, UpdateNPCHome }, + {PacketTypes.UpdateNPCHome, UpdateNPCHome}, {PacketTypes.PlayerAddBuff, HandlePlayerBuff}, {PacketTypes.ItemDrop, HandleItemDrop}, {PacketTypes.PlayerHp, HandlePlayerHp}, @@ -937,7 +936,8 @@ namespace TShockAPI args.Player.SendData(PacketTypes.PlayerBuff, "", id); return true; } - if (WhitelistBuffs[type]) + + if (WhitelistBuffMaxTime[type] > 0 && time < WhitelistBuffMaxTime[type]) { return false; }