Skip to content

Commit

Permalink
Merge pull request #933 from JustAGenericUsername/main
Browse files Browse the repository at this point in the history
piston the no
  • Loading branch information
slweeb authored Jan 13, 2025
2 parents 1093184 + 7c988af commit 7ce1d22
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions mods/nousersthings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,15 @@ elements.ray_emitter.desc = "Emits a ray of the specified element in the opposit
elements.specific_ray_emitter.desc = "Emits a ray of the specified element in a specific direction and a specific length."
elements.blackhole_storage.desc = "Stores elements inside of itself. Can be released by shocking it."
let pullOrPush = 1
elements.anchor = {
color: "#020c20",
category: "machines",
behavior: behaviors.WALL,
desc: "Anchor; unpushable and unpullable by pistons.",
onSelect: function(){
logMessage("Unpushable and unpullable by pistons.")
}
}
elements.piston_ray_emitter = {
color: "#143b5f",
behavior: behaviors.WALL,
Expand Down Expand Up @@ -3104,8 +3113,9 @@ elements.piston_ray_emitter = {
var lx = lcoord[0];
var ly = lcoord[1];
if (!isEmpty(lx, ly, true)){
if (pixelMap[lx][ly].element == "insulator"){break;}
tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true)
if (!(pixelMap[lx][ly].element == "anchor")){
tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true)
}
}
pCoord[0] = lx;
pCoord[1] = ly;
Expand Down Expand Up @@ -3144,7 +3154,9 @@ function pistonEmit(pixel, i){
var lx = lcoord[0];
var ly = lcoord[1];
if (!isEmpty(lx, ly, true)){
tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true)
if (!(pixelMap[lx][ly].element == "anchor")){
tryMove(pixelMap[lx][ly], pCoord[0], pCoord[1], null, true)
}
}
pCoord[0] = lx;
pCoord[1] = ly;
Expand Down

0 comments on commit 7ce1d22

Please sign in to comment.