mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
move unchanging value out of loop
This commit is contained in:
parent
d2bf33dcc7
commit
0deb08901b
@ -104,6 +104,8 @@ export class HUDWiresOverlay extends BaseHUDPart {
|
||||
const pinComp = contents.components.WiredPins;
|
||||
const staticComp = contents.components.StaticMapEntity;
|
||||
|
||||
const mouseTilePos = this.root.camera.screenToWorld(mousePos);
|
||||
|
||||
// Go over all slots and see if they are close to mouse or not
|
||||
const pinSlots = pinComp.slots;
|
||||
for (let i = 0; i < pinSlots.length; ++i) {
|
||||
@ -115,8 +117,6 @@ export class HUDWiresOverlay extends BaseHUDPart {
|
||||
}
|
||||
|
||||
// Check if slot is close to mouse
|
||||
const mouseTilePos = this.root.camera.screenToWorld(mousePos);
|
||||
|
||||
// Dirty math that I don't like the look of
|
||||
const slotPos = staticComp.localTileToWorld(slot.pos).toWorldSpaceCenterOfTile();
|
||||
const effectiveRotation = Math.radians(
|
||||
|
Loading…
Reference in New Issue
Block a user