mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-06 19:44:15 -04:00
* Added RecordManager implementation to remove d2datadict singletons * fix object lookup test
27 lines
479 B
Go
27 lines
479 B
Go
package d2records
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt"
|
|
|
|
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
|
|
)
|
|
|
|
func armorLoader(r *RecordManager, d *d2txt.DataDictionary) error {
|
|
if r.Item.Armors != nil {
|
|
return nil // already loaded
|
|
}
|
|
|
|
records, err := loadCommonItems(d, d2enum.InventoryItemTypeArmor)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
log.Printf("Loaded %d armors", len(records))
|
|
|
|
r.Item.Armors = records
|
|
|
|
return nil
|
|
}
|