|
|
|
|
@ -100,7 +100,6 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string id = GetMeta("SaveID").AsString();
|
|
|
|
|
GD.Print($"Updating Save ID for object {Name}: {id}");
|
|
|
|
|
SavegameService.AppendDataToSave( id, payloadData);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -111,7 +110,6 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
|
|
|
|
|
// standard check: how many times has this item been collected?
|
|
|
|
|
string id = GetMeta("SaveID").AsString();
|
|
|
|
|
GD.Print($"Loading Save ID for object {Name}: " + id);
|
|
|
|
|
|
|
|
|
|
Dictionary<string, Variant> save = SavegameService.GetSaveData(id);
|
|
|
|
|
if (save.Count > 0)
|
|
|
|
|
@ -119,11 +117,9 @@ public partial class ItemOnGround2D : Node, ISaveable
|
|
|
|
|
if(save.TryGetValue("pickupCounter", out Variant countVar))
|
|
|
|
|
{
|
|
|
|
|
int count = countVar.AsInt32();
|
|
|
|
|
GD.Print($"Item count for {Name}: {count}");
|
|
|
|
|
for (int i = 0; i < count; i++)
|
|
|
|
|
{
|
|
|
|
|
Pickup();
|
|
|
|
|
GD.Print($"Picking up {Name}: {i}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|