From d4709a31f1b9c57960560305549bed8e2a8035f7 Mon Sep 17 00:00:00 2001 From: Zack Piispanen Date: Sat, 15 Dec 2012 00:09:29 -0500 Subject: [PATCH] Added config option to utilize the allowed group on itembans Support the config option and allow users on the allowed list to use the banned item. --- TShockAPI/ConfigFile.cs | 2 ++ TShockAPI/TSPlayer.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 8ad3a8d4..d3da94fc 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -245,6 +245,8 @@ namespace TShockAPI [Description("Force Christmas only events to occur all year.")] public bool ForceXmas = false; + [Description("Allows groups on the banned item allowed list to spawn banned items.")] public bool AllowAllowedGroupsToSpawnBannedItems = false; + /// /// Reads a configuration file from a given path /// diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 96a4b9c9..a488018b 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -557,7 +557,8 @@ namespace TShockAPI public bool GiveItemCheck(int type, string name, int width, int height, int stack, int prefix = 0) { - if (TShock.Itembans.ItemIsBanned(name) && TShock.Config.PreventBannedItemSpawn) + if ((TShock.Itembans.ItemIsBanned(name) && TShock.Config.PreventBannedItemSpawn) && + (TShock.Itembans.ItemIsBanned(name, this) || !TShock.Config.AllowAllowedGroupsToSpawnBannedItems)) return false; GiveItem(type,name,width,height,stack,prefix);