Fix bug where resources weren't assigned correctly after building
This commit is contained in:
parent
69b32f43b5
commit
61e8d9d9fc
|
@ -65,7 +65,7 @@ export default abstract class ResourceManager {
|
||||||
await this.calculateCurrentAvailableResources();
|
await this.calculateCurrentAvailableResources();
|
||||||
for(const res of resources) {
|
for(const res of resources) {
|
||||||
const resource = this.resources.find(r => r.id === res.id);
|
const resource = this.resources.find(r => r.id === res.id);
|
||||||
if(resource) resource.amount += res.amount;
|
if(resource) resource.amount = res.amount;
|
||||||
else this.resources.push({
|
else this.resources.push({
|
||||||
id: res.id,
|
id: res.id,
|
||||||
amount: res.amount,
|
amount: res.amount,
|
||||||
|
|
Loading…
Reference in New Issue