1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

copy past broken, check for more uids in draw

This commit is contained in:
dgs4349 2021-06-24 14:03:13 -04:00
parent a80ae03b68
commit 9ab92a1bdb
4 changed files with 7 additions and 12 deletions

View File

@ -12,6 +12,7 @@ import { KEYMAPPINGS } from "../../key_action_mapper";
import { THEME } from "../../theme"; import { THEME } from "../../theme";
import { enumHubGoalRewards } from "../../tutorial_goals"; import { enumHubGoalRewards } from "../../tutorial_goals";
import { BaseHUDPart } from "../base_hud_part"; import { BaseHUDPart } from "../base_hud_part";
import { enumMouseButton } from "../../camera";
const logger = createLogger("hud/mass_selector"); const logger = createLogger("hud/mass_selector");
@ -139,13 +140,12 @@ export class HUDMassSelector extends BaseHUDPart {
} }
clearBelts() { clearBelts() {
for (const uid of this.selectedUids) { for (const entity of this.selectedEntities) {
const entity = this.root.entityMgr.findByUid(uid);
for (const component of Object.values(entity.components)) { for (const component of Object.values(entity.components)) {
/** @type {Component} */ (component).clear(); /** @type {Component} */ (component).clear();
} }
} }
this.selectedUids = new Set(); this.selectedEntities = new Set();
} }
confirmCut() { confirmCut() {

View File

@ -12,14 +12,9 @@ export class BeltReaderSystem extends GameSystemWithFilter {
const now = this.root.time.now(); const now = this.root.time.now();
const minimumTime = now - globalConfig.readerAnalyzeIntervalSeconds; const minimumTime = now - globalConfig.readerAnalyzeIntervalSeconds;
const minimumTimeForThroughput = now - 1; const minimumTimeForThroughput = now - 1;
<<<<<<< HEAD
for (let i = this.allEntitiesArray.length - 1; i >= 0; --i) { for (let i = this.allEntitiesArray.length - 1; i >= 0; --i) {
const entity = this.allEntitiesArray[i]; const entity = this.allEntitiesArray[i];
=======
for (let i = 0; i < this.allEntities.length; ++i) {
const entity = this.allEntities[i];
>>>>>>> 5074727efa4910acdb298bbed28c9e7bd1d7849d
const readerComp = entity.components.BeltReader; const readerComp = entity.components.BeltReader;
const pinsComp = entity.components.WiredPins; const pinsComp = entity.components.WiredPins;

View File

@ -14,8 +14,8 @@ export class ConstantProducerSystem extends GameSystemWithFilter {
} }
update() { update() {
for (let i = 0; i < this.allEntities.length; ++i) { for (let i = this.allEntitiesArray.length - 1; i >= 0; --i) {
const entity = this.allEntities[i]; const entity = this.allEntitiesArray[i];
const signalComp = entity.components.ConstantSignal; const signalComp = entity.components.ConstantSignal;
const ejectorComp = entity.components.ItemEjector; const ejectorComp = entity.components.ItemEjector;
if (!ejectorComp) { if (!ejectorComp) {

View File

@ -20,8 +20,8 @@ export class GoalAcceptorSystem extends GameSystemWithFilter {
let allAccepted = true; let allAccepted = true;
for (let i = 0; i < this.allEntities.length; ++i) { for (let i = this.allEntitiesArray.length - 1; i >= 0; --i) {
const entity = this.allEntities[i]; const entity = this.allEntitiesArray[i];
const goalComp = entity.components.GoalAcceptor; const goalComp = entity.components.GoalAcceptor;
if (!goalComp.lastDelivery) { if (!goalComp.lastDelivery) {