When adding a new building the plugins needs reloaded to recognise it to protect it :S
New TC not being recognised.Bug
Shouldn't be anymore, try v2.1.7
will do thank you, i have been running a reload script to fix it.
Let me know if its still an issue!
Hey mate, yea ive got the latest oine installed still same issue im using a timed exec to reload the plugin every minute.
I'm seeing a similar issue where when a player puts down a new TC they don't get protection until they de-auth and then re-auth to the TC. Every new player that joins asks about it because I have the plugin set to always show the status when you are within building priviledge. I'll see this error in the console too:ftugaHey mate, yea ive got the latest oine installed still same issue im using a timed exec to reload the plugin every minute.
Failed to call hook 'OnLootNetworkUpdate' on plugin 'RaidProtection v2.1.7' (NullReferenceException: Object reference not set to an instance of an object)
at Oxide.Plugins.RaidProtection+ProtectedCupboard.UpdateCostDebt (System.Single amount, System.Int32 minAmount) [0x00088] in <5d0a70634ea4444588091ec981629f2f>:0
at Oxide.Plugins.RaidProtection+ProtectedCupboard.InitialPurchaseProtection () [0x00093] in <5d0a70634ea4444588091ec981629f2f>:0
at Oxide.Plugins.RaidProtection.OnLootNetworkUpdate (PlayerLoot loot) [0x00075] in <5d0a70634ea4444588091ec981629f2f>:0
at Oxide.Plugins.RaidProtection.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x01174] in <5d0a70634ea4444588091ec981629f2f>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <60c318df79ed41688ea59335e48d61ad>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <dfcb48ea05694263bbc08e62a39c274c>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <dfcb48ea05694263bbc08e62a39c274c>:0I'm not 100% sure if it's related, but it could be and I will usually see this error then shortly afterwards the player would ask about the "Unprotected" message displaying on their screen. Then I tell them to de-auth and re-auth and it's fine. I was going to do some testing today to see if I can determine what's going on, but I've gotten caught up in a plugin I'm writing myself.
I'm sure restarting the plugin solves this issue as well, but I think I figured out a while ago you could just do the de-auth/re-auth trick to resolve it, but I haven't had time to come back and do more investigating.
Looks like I may have resolved the issue I was seeing. It was in the UpdateCostDebt() function:
var item = Priv.inventory.FindItemByItemID(PLUGIN.config.Settings.CurrencyItemId);
if (item != null)
item.UseItem(1);
Updated the line looking for the item to pay with to check for a null item as this would be null when first laying down a TC and you are using an item such as scrap (which I am)