pushing current
This commit is contained in:
@@ -217,7 +217,7 @@ func (l *Lease) SaveCommand(ctx context.Context, w *game.World, claimID string,
|
||||
}
|
||||
l.Revision++
|
||||
for id, c := range w.Characters {
|
||||
live.Characters[id].View.Titles = c.View.Titles
|
||||
live.Characters[id].View = c.View
|
||||
}
|
||||
live.PendingTitles = nil
|
||||
live.Saved()
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"database/sql"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"maps"
|
||||
"sort"
|
||||
|
||||
"aeternalis/server/internal/game"
|
||||
@@ -19,6 +20,10 @@ func stageTitleWorld(w *game.World) *game.World {
|
||||
for id, c := range w.Characters {
|
||||
copy := *c
|
||||
copy.View.Titles = append([]p.TitleAward{}, c.View.Titles...)
|
||||
copy.View.Items = append([]p.ItemInstance{}, c.View.Items...)
|
||||
copy.View.Equipment = maps.Clone(c.View.Equipment)
|
||||
copy.View.AllocatedStats = maps.Clone(c.View.AllocatedStats)
|
||||
copy.View.Stats = maps.Clone(c.View.Stats)
|
||||
staged.Characters[id] = ©
|
||||
}
|
||||
return &staged
|
||||
@@ -96,6 +101,7 @@ func (d *DB) syncTitles(ctx context.Context, tx *sql.Tx, w *game.World) error {
|
||||
}
|
||||
if c.View.Entity.State != "dead" {
|
||||
c.View.Titles = append([]p.TitleAward{}, awards...)
|
||||
w.RefreshStats(c)
|
||||
continue
|
||||
}
|
||||
// A historical dead life keeps its own record. Only awards from its death
|
||||
|
||||
Reference in New Issue
Block a user