fix(server): preserve chosen story parties and validate fixed tactics decks

This commit is contained in:
2026-10-06 17:05:01 +08:00
parent 9e9e86a658
commit c428fc308e
14 changed files with 635 additions and 257 deletions
-19
View File
@@ -22,22 +22,3 @@ func (s *Store) visibleFieldDeckLocked() []FieldEntry {
}
return out
}
// SetStoryParty stores the authored active quest formation using the same
// character ownership checks as DeckSave. Empty formation keeps player choice.
func (s *Store) SetStoryParty(entries []DeckEntry) error {
if len(entries) == 0 {
return nil
}
if err := validDeck(entries); err != nil {
return err
}
s.mu.Lock()
defer s.mu.Unlock()
if err := s.validateOwnedDeckLocked(entries); err != nil {
return err
}
next := clone(s.state)
next.Deck = append([]DeckEntry(nil), entries...)
return s.commit(next)
}