fix errors on insertion to game, fix db creation of game

This commit is contained in:
lbenedar
2026-04-23 19:03:56 +03:00
parent f46ff8333e
commit 07025afefc
36 changed files with 1820 additions and 693 deletions

View File

@@ -9,15 +9,20 @@ type Ring struct {
Subject Subject `json:"subject"`
}
func (r *Ring) ToDB(dest *db.Ring) bool {
func (r *Ring) ToDB(dest **db.Ring) bool {
if dest == nil {
return false
}
dest.Enabled = r.Enabled
dest.Effects = r.Effects
r.RingColors.ToDB(&dest.RingColors)
r.Subject.ToDB(&dest.Subject)
ring := &db.Ring{
Enabled: r.Enabled,
Effects: r.Effects,
}
r.RingColors.ToDB(&ring.RingColors)
r.Subject.ToDB(&ring.Subject)
*dest = ring
return true
}