Skip to content

Commit

Permalink
update activity.js
Browse files Browse the repository at this point in the history
  • Loading branch information
haroon10725 committed Sep 3, 2024
1 parent 1830b47 commit c61110f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,7 @@ class Activity {
// default values
this.DEFAULTDELAY = 500; // milleseconds
this.TURTLESTEP = -1; // Run in step-by-step mode
this.blockscale = BLOCKSCALES.indexOf(DEFAULTBLOCKSCALE);
if (this.blockscale === -1) {
if (!BLOCKSCALES.includes(DEFAULTBLOCKSCALE)) {
this.blockscale = 1;
}

Expand Down Expand Up @@ -2907,10 +2906,8 @@ class Activity {
this.logo.tempo.resume();
}
if (
this.blocks.activeBlock === null ||
SPECIALINPUTS.indexOf(
this.blocks.blockList[this.blocks.activeBlock].name
) === -1
this.blocks.activeBlock === null ||
!SPECIALINPUTS.includes(this.blocks.blockList[this.blocks.activeBlock].name)
) {
this.logo.runLogoCommands();
}
Expand Down Expand Up @@ -5651,8 +5648,7 @@ class Activity {

const connections = [];
for (let c = 0; c < myBlock.connections.length; c++) {
const mapConnection = blockMap.indexOf(myBlock.connections[c]);
if (myBlock.connections[c] === null || mapConnection === -1) {
if (myBlock.connections[c] === null || !blockMap.includes(myBlock.connections[c])) {
connections.push(null);
} else {
connections.push(mapConnection);
Expand Down

0 comments on commit c61110f

Please sign in to comment.