fix(server): preserve chosen story parties and validate fixed tactics decks
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user