From 684b305af5c9d268cc1a88abb70a40f4b1196934 Mon Sep 17 00:00:00 2001 From: Madpeter <57852827+Madpeterz@users.noreply.github.com> Date: Sun, 23 Jun 2024 22:01:35 +0100 Subject: [PATCH] move the inventory update event trigger to a better place --- SecondBotEvents/Services/InteractionService.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SecondBotEvents/Services/InteractionService.cs b/SecondBotEvents/Services/InteractionService.cs index dad1b24..284f515 100644 --- a/SecondBotEvents/Services/InteractionService.cs +++ b/SecondBotEvents/Services/InteractionService.cs @@ -165,11 +165,17 @@ namespace SecondBotEvents.Services protected void BotInventoryAdd(object o, InventoryObjectAddedEventArgs e) { + InventoryItem F = (InventoryItem)e.Obj; Dictionary details = new Dictionary { { "itemname", e.Obj.Name }, { "itemuuid", e.Obj.UUID.ToString() }, + { "itemtype", F.AssetType.ToString() }, }; + if (master.EventsService.isRunning() == true) + { + master.EventsService.InventoryUpdateEvent(details); + } JsonOuputCleaner(details, "InventoryAdd"); } @@ -198,10 +204,6 @@ namespace SecondBotEvents.Services details["itemname"] = itm.Name; } } - if(master.EventsService.isRunning() == true) - { - master.EventsService.InventoryUpdateEvent(details); - } JsonOuputCleaner(details, "InventoryOffer"); }