Skip to content

Commit 9180d0f

Browse files
committed
Make GC compatible with old states without hull color
1 parent 2eea429 commit 9180d0f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/app/store/store.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ func (s *Store) Load() error {
9191
if err := protojson.Unmarshal(b, entry); err != nil {
9292
return errors.Errorf("Could not unmarshal entry: %v %v", b, err)
9393
}
94+
// Compatibility: Add hull colors to older states
95+
for _, team := range state.BothTeams() {
96+
if entry.State.TeamInfo(team).HullColor == nil {
97+
entry.State.TeamInfo(team).HullColor = new(state.HullColor)
98+
}
99+
}
94100
s.entries = append(s.entries, entry)
95101
}
96102

0 commit comments

Comments
 (0)