Skip to content

Commit

Permalink
Only enable PlaceAnywhere when applying a layout
Browse files Browse the repository at this point in the history
  • Loading branch information
jawslouis committed Jul 27, 2024
1 parent 6739b91 commit f092e68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions MakePlacePlugin/MakePlacePlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ public class MakePlacePlugin : IDalamudPlugin

public void Dispose()
{

HookManager.Dispose();

Memory.Instance.SetPlaceAnywhere(false);

DalamudApi.ClientState.TerritoryChanged -= TerritoryChanged;
DalamudApi.CommandManager.RemoveHandler("/makeplace");
Gui?.Dispose();
Expand Down Expand Up @@ -195,6 +192,8 @@ public unsafe void PlaceItems()
GetPlotLocation();
}

Memory.Instance.SetPlaceAnywhere(true);

while (ItemsToPlace.Count > 0)
{
var item = ItemsToPlace.First();
Expand Down Expand Up @@ -228,6 +227,7 @@ public unsafe void PlaceItems()
LogError($"Error: {e.Message}", e.StackTrace);
}

Memory.Instance.SetPlaceAnywhere(false);
CurrentlyPlacingItems = false;
}

Expand Down
1 change: 0 additions & 1 deletion MakePlacePlugin/Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ private Memory()
public static void Init()
{
Instance = new Memory();
Instance.SetPlaceAnywhere(true);
}

public static InventoryContainer* GetContainer(InventoryType inventoryType)
Expand Down

0 comments on commit f092e68

Please sign in to comment.