diff --git a/sim/core/database.go b/sim/core/database.go index 204571e366..9a863231c2 100644 --- a/sim/core/database.go +++ b/sim/core/database.go @@ -10,26 +10,23 @@ import ( var WITH_DB = false -var ItemsByID map[int32]Item -var GemsByID map[int32]Gem -var EnchantsByEffectID map[int32]Enchant +var ItemsByID = map[int32]Item{} +var GemsByID = map[int32]Gem{} +var EnchantsByEffectID = map[int32]Enchant{} func addToDatabase(newDB *proto.SimDatabase) { - ItemsByID = make(map[int32]Item, len(newDB.Items)) for _, v := range newDB.Items { if _, ok := ItemsByID[v.Id]; !ok { ItemsByID[v.Id] = ItemFromProto(v) } } - EnchantsByEffectID = make(map[int32]Enchant, len(newDB.Enchants)) for _, v := range newDB.Enchants { if _, ok := EnchantsByEffectID[v.EffectId]; !ok { EnchantsByEffectID[v.EffectId] = EnchantFromProto(v) } } - GemsByID = make(map[int32]Gem, len(newDB.Gems)) for _, v := range newDB.Gems { if _, ok := GemsByID[v.Id]; !ok { GemsByID[v.Id] = GemFromProto(v)