Migrate NPC registry durable contract
This commit is contained in:
@@ -28,7 +28,7 @@ func appendSpellLists(values []dnd.SpellList) (dnd.SpellList, error) {
|
||||
return combined, nil
|
||||
}
|
||||
|
||||
func appendNPCLists(values []dnd.NPCList) (dnd.NPCList, error) {
|
||||
func appendNPCRegistries(values []dnd.NPCRegistry) (dnd.NPCRegistry, error) {
|
||||
count := 0
|
||||
present := false
|
||||
for _, value := range values {
|
||||
@@ -38,9 +38,9 @@ func appendNPCLists(values []dnd.NPCList) (dnd.NPCList, error) {
|
||||
count += len(value.NPCs)
|
||||
}
|
||||
if !present {
|
||||
return dnd.NPCList{}, nil
|
||||
return dnd.NPCRegistry{}, nil
|
||||
}
|
||||
combined := dnd.NPCList{NPCs: make([]dnd.NPC, 0, count)}
|
||||
combined := dnd.NPCRegistry{NPCs: make([]dnd.NPC, 0, count)}
|
||||
for _, value := range values {
|
||||
for _, npc := range value.NPCs {
|
||||
combined.NPCs = append(combined.NPCs, cloneNPC(npc))
|
||||
|
||||
Reference in New Issue
Block a user