diff --git a/ent/dict.go b/ent/dict.go index 680dde0..594a8a3 100644 --- a/ent/dict.go +++ b/ent/dict.go @@ -92,8 +92,7 @@ func (d *Dict) updateEntity(id int) error { if e == nil { return fmt.Errorf("update entity %d refused: no such entity", id) } - // e.Read(d.br, d.sr) - return nil + return fillSlots(e, e.Class.String(), d.sr, d.br) } func (d *Dict) deleteEntity(id int) error { @@ -122,7 +121,9 @@ func (d *Dict) Handle(m proto.Message) { d.syncBaselines() case *dota.CSVCMsg_PacketEntities: - d.mergeEntities(v) + if err := d.mergeEntities(v); err != nil { + Debug.Printf("merge entities error: %v", err) + } } } @@ -133,8 +134,7 @@ func (d *Dict) mergeEntities(m *dota.CSVCMsg_PacketEntities) error { d.br.SetSource(data) id := -1 - // for i := 0; i < int(m.GetUpdatedEntries()); i++ { - for i := 0; i < 1; i++ { + for i := 0; i < int(m.GetUpdatedEntries()); i++ { id++ // there may be a jump indicator, indicating how many id positions // to skip. diff --git a/ent/selection.go b/ent/selection.go index 7c4709c..2243a5c 100644 --- a/ent/selection.go +++ b/ent/selection.go @@ -20,6 +20,7 @@ func (s selection) String() string { return fmt.Sprint(s.path()) } func (s selection) path() []int { return s.vals[:s.count] } func (s selection) fill(offset int, displayPath string, dest slotted, br bit.Reader) error { + Debug.Printf("fill selection: %s offset: %d displayPath: %s dest: %v", s, offset, displayPath, dest) slot := s.vals[offset] if s.count-offset <= 0 { panic("selection makes no sense") diff --git a/ent/type_spec.go b/ent/type_spec.go index fc8f79c..a099d2d 100644 --- a/ent/type_spec.go +++ b/ent/type_spec.go @@ -82,7 +82,7 @@ func parseArrayName(s string) (string, int) { n, err := strconv.Atoi(ns) if err != nil { n = cIdents[ns] - if n == 0 { + if n <= 0 { panic("invalid array type name: " + err.Error()) } }