Fixed RiskItAll resource handling method

This commit is contained in:
WBHarry 2026-01-13 23:10:28 +01:00
parent 7ca4a5fae2
commit 89ba240998
6 changed files with 72 additions and 55 deletions

View file

@ -364,14 +364,14 @@ export class ResourceUpdateMap extends Map {
if (!resource.key) continue;
const existing = this.get(resource.key);
if (existing) {
if (!existing || resource.clear) {
this.set(resource.key, resource);
} else if (!existing?.clear) {
this.set(resource.key, {
...existing,
value: existing.value + (resource.value ?? 0),
total: existing.total + (resource.total ?? 0)
});
} else {
this.set(resource.key, resource);
}
}
}