added item.deconstructed hook, misc registers and luacs is now initialized before campaign/sub editor is loaded

This commit is contained in:
Evil Factory
2022-05-10 13:55:10 -03:00
parent 45efbd8e08
commit 2630c8354c
5 changed files with 12 additions and 6 deletions
@@ -301,6 +301,9 @@ namespace Barotrauma.Items.Components
GameAnalyticsManager.AddDesignEvent("ItemDeconstructed:" + (GameMain.GameSession?.GameMode?.Preset.Identifier.Value ?? "none") + ":" + targetItem.Prefab.Identifier);
bool? result = GameMain.LuaCs.Hook.Call<bool?>("item.deconstructed", targetItem, this, user, allowRemove);
if (result == true) { return; }
if (targetItem.AllowDeconstruct && allowRemove)
{
//drop all items that are inside the deconstructed item