Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ItemPreserver/ItemPreserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ private void ReloadConfig(ReloadEventArgs args)
LoadConfig();
foreach (var ply in TShock.Players)
{
if (!ItemUse.TryGetValue(ply, out var slot) || slot == null)
{
ItemUse[ply] = new Dictionary<int, Pitem>();
}
if (ply != null && ply.Active)
{
if (!ItemUse.TryGetValue(ply, out var slot) || slot == null)
{
ItemUse[ply] = new Dictionary<int, Pitem>();
}
for (int i = 0; i < ply.TPlayer.inventory.Length; i++)
{
ItemUse[ply][i] = new(ply.TPlayer.inventory[i].netID, ply.TPlayer.inventory[i].stack);
Expand Down