fixed item repository bug

This commit is contained in:
2025-09-10 15:06:49 +02:00
parent d1a8ff0cbf
commit 975dd45c94
6 changed files with 13 additions and 7 deletions
@@ -83,13 +83,11 @@ public partial class FieldBehaviour2D : Sprite2D
if (item == null || PlantingPlaceholder.GetChildCount() > 0)
return success;
string prefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
if (prefabPath != null)
{
// todo: Error: cannot convert value at key from string to object
PackedScene prefab = ResourceLoader.Load<PackedScene>(prefabPath, nameof(PackedScene));
Node2D plant2d = prefab.Instantiate<Node2D>();
PlantingPlaceholder.AddChild(plant2d);
@@ -102,7 +100,6 @@ public partial class FieldBehaviour2D : Sprite2D
}
success = true;
}
return success;
@@ -1,3 +1,4 @@
using Godot;
using Godot.Collections;
@@ -0,0 +1 @@
uid://oafmfqkdqewd