step 10.1: done

This commit is contained in:
bepis
2026-10-22 22:08:22 +11:00
parent d115f49eaf
commit 120cf88015
4 changed files with 68 additions and 19 deletions
+3 -3
View File
@@ -129,12 +129,12 @@ function startExpedition(characterId, defId) {
const endsAt = startedAt + (def.duration_sec * 1000);
// Execute inside a transaction.
const doStart = db.transaction((nc, ne, eat, cid, defid, sat) => {
const doStart = db.transaction((cid, ne, eat, defid, sat, endAt) => {
s.updateEnergy.run(ne, eat, cid);
s.insertExpedition.run(cid, defid, sat, eat);
s.insertExpedition.run(cid, defid, sat, endAt);
});
doStart(newEnergy, def.energy_cost, endsAt, characterId, defId, startedAt);
doStart(characterId, newEnergy, updatedAtMs, defId, startedAt, endsAt);
// Read back the just-inserted expedition (latest active for this character).
const inserted = s.activeExpedition.get(characterId);