From de0d205fd35a8f904eaef10adfbd85cc5bcb0362 Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:07:51 -0800 Subject: [PATCH] fix: Fixes importing spawners (#1689) --- .../Engines/Spawners/SpawnerEntry.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Projects/UOContent/Engines/Spawners/SpawnerEntry.cs b/Projects/UOContent/Engines/Spawners/SpawnerEntry.cs index d75a0d907e..1ff0deaf7d 100644 --- a/Projects/UOContent/Engines/Spawners/SpawnerEntry.cs +++ b/Projects/UOContent/Engines/Spawners/SpawnerEntry.cs @@ -38,21 +38,32 @@ public partial class SpawnerEntry public SpawnerEntry(BaseSpawner parent) { _parent = parent; - _spawned = new List(); + _spawned = []; + } + + [JsonConstructor] + public SpawnerEntry( + string spawnedName, + int spawnedProbability = 100, + int spawnedMaxCount = 1, + string properties = null, + string parameters = null + ) : this(null, spawnedName, spawnedProbability, spawnedMaxCount, properties, parameters) + { } public SpawnerEntry( BaseSpawner parent, string name, - int probability, - int maxcount, + int probability = 100, + int maxCount = 1, string properties = null, string parameters = null ) : this(parent) { SpawnedName = name; SpawnedProbability = probability; - SpawnedMaxCount = maxcount; + SpawnedMaxCount = maxCount; Properties = properties; Parameters = parameters; }