function ChangeElevatorWalls takes boolean open, integer walls, destructable d returns nothing
local real x = GetDestructableX(d)
local real y = GetDestructableY(d)
local real distToBlocker = 192
local real distToNeighbor = 256
if (walls == bj_ELEVATOR_WALL_TYPE_ALL) or (walls == bj_ELEVATOR_WALL_TYPE_EAST) then
if (not NearbyElevatorExists(x + distToNeighbor, y)) then
call ChangeElevatorWallBlocker(x + distToBlocker, y, 0, open)
endif
endif
if (walls == bj_ELEVATOR_WALL_TYPE_ALL) or (walls == bj_ELEVATOR_WALL_TYPE_NORTH) then
if (not NearbyElevatorExists(x, y + distToNeighbor)) then
call ChangeElevatorWallBlocker(x, y + distToBlocker, 90, open)
endif
endif
if (walls == bj_ELEVATOR_WALL_TYPE_ALL) or (walls == bj_ELEVATOR_WALL_TYPE_SOUTH) then
if (not NearbyElevatorExists(x, y - distToNeighbor)) then
call ChangeElevatorWallBlocker(x, y - distToBlocker, 90, open)
endif
endif
if (walls == bj_ELEVATOR_WALL_TYPE_ALL) or (walls == bj_ELEVATOR_WALL_TYPE_WEST) then
if (not NearbyElevatorExists(x - distToNeighbor, y)) then
call ChangeElevatorWallBlocker(x - distToBlocker, y, 0, open)
endif
endif
endfunction