delete vouchers when claiming them
parent
174b962f19
commit
e7cff35d69
|
@ -57,6 +57,10 @@ func Get(uuid []byte, datatype, slot int) (any, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to update system save data: %s", err)
|
return nil, fmt.Errorf("failed to update system save data: %s", err)
|
||||||
}
|
}
|
||||||
|
err = db.DeleteClaimedAccountCompensations(uuid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to delete claimed compensations: %s", err)
|
||||||
|
}
|
||||||
|
|
||||||
err = db.UpdateAccountStats(uuid, system.GameStats, system.VoucherCounts)
|
err = db.UpdateAccountStats(uuid, system.GameStats, system.VoucherCounts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -47,11 +47,6 @@ func Update(uuid []byte, slot int, save any) error {
|
||||||
return fmt.Errorf("failed to update account stats: %s", err)
|
return fmt.Errorf("failed to update account stats: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = db.DeleteClaimedAccountCompensations(uuid)
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("failed to delete claimed compensations: %s", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return db.StoreSystemSaveData(uuid, save)
|
return db.StoreSystemSaveData(uuid, save)
|
||||||
|
|
||||||
case defs.SessionSaveData: // Session
|
case defs.SessionSaveData: // Session
|
||||||
|
|
Loading…
Reference in New Issue