mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
Show that chainable miners can connect to eachother during placement (#613)
Removes the red X when placing a chainable miner feeding into another chainable miner, and instead shows it as a green arrow.
This commit is contained in:
parent
5c105d8096
commit
bdb08f67d8
@ -454,6 +454,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
const ejectorComp = this.fakeEntity.components.ItemEjector;
|
||||
const staticComp = this.fakeEntity.components.StaticMapEntity;
|
||||
const beltComp = this.fakeEntity.components.Belt;
|
||||
const minerComp = this.fakeEntity.components.Miner;
|
||||
|
||||
const goodArrowSprite = Loader.getSprite("sprites/misc/slot_good_arrow.png");
|
||||
const badArrowSprite = Loader.getSprite("sprites/misc/slot_bad_arrow.png");
|
||||
@ -571,6 +572,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
const destEntity = destEntities[i];
|
||||
const destAcceptor = destEntity.components.ItemAcceptor;
|
||||
const destStaticComp = destEntity.components.StaticMapEntity;
|
||||
const destMiner = destEntity.components.Miner;
|
||||
|
||||
const destLocalTile = destStaticComp.worldToLocalTile(ejectorSlotWsTile);
|
||||
const destLocalDir = destStaticComp.worldDirectionToLocal(ejectorSlotWsDirection);
|
||||
@ -580,6 +582,9 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic {
|
||||
} else if (destEntity.components.Belt && destLocalDir === enumDirection.top) {
|
||||
// Connected to a belt
|
||||
isConnected = true;
|
||||
} else if (minerComp && minerComp.chainable && destMiner && destMiner.chainable) {
|
||||
// Chainable miners connected to eachother
|
||||
isConnected = true;
|
||||
} else {
|
||||
// This one is blocked
|
||||
isBlocked = true;
|
||||
|
Loading…
Reference in New Issue
Block a user