fix errors on insertion to game, fix db creation of game
This commit is contained in:
@@ -18,24 +18,28 @@ type Actor struct {
|
||||
// ActorsEffects []any `json:"effects"`
|
||||
}
|
||||
|
||||
func (a *Actor) ToDB(dest *db.Actor) bool {
|
||||
func (a *Actor) ToDB(dest **db.Actor) bool {
|
||||
if dest == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
dest.Img = a.Img
|
||||
dest.Name = a.Name
|
||||
dest.Type = a.Type
|
||||
dest.Folder = a.Folder
|
||||
dest.Sort = a.Sort
|
||||
dest.ID = a.ID
|
||||
actor := &db.Actor{
|
||||
Img: a.Img,
|
||||
Name: a.Name,
|
||||
Type: a.Type,
|
||||
Folder: a.Folder,
|
||||
Sort: a.Sort,
|
||||
ID: a.ID,
|
||||
}
|
||||
|
||||
a.PrototypeToken.ToDB(&dest.PrototypeToken)
|
||||
a.Stats.ToDB(&dest.Stats)
|
||||
a.PrototypeToken.ToDB(&actor.PrototypeToken)
|
||||
a.Stats.ToDB(&actor.Stats)
|
||||
|
||||
OwnershipToDB(&dest.Ownership, a.Ownership)
|
||||
OwnershipToDB(&actor.Ownership, a.Ownership)
|
||||
|
||||
CopySliceToDB(&dest.Items, a.Items)
|
||||
CopySliceToDB(&actor.Items, a.Items)
|
||||
|
||||
*dest = actor
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user