False TERRAIN_MASK_WALL where is ConstructedWall



  • shard3, W8N8, surroundings just became novice area.

    Because of that the top exit just became indestructible walls (hits == undefined).

    When I try to find out if the Y=0 tiles are terrain wall or constructed walls with no hits then there is some strange behavior:

    x - terrain - construced
    0 1 0
    1 1 0
    2 1 0
    3 1 0
    4 1 1 should be "4 0 1"
    5 0 1
    6 0 1
    7 0 1
    8 0 1
    9 0 1
    10 0 1
    11 1 1 should be "11 0 1"
    12 1 1 should be "12 0 1"
    13 1 1 should be "13 0 1"
    14 1 1 should be "14 0 1"
    15 1 1 should be "15 0 1"
    16 1 1 should be "16 0 1"
    17 1 0
    18 1 0
    19 1 0
    20 1 0
    21 1 0
    22 1 0
    23 1 0
    24 1 0
    25 1 0
    26 1 0
    27 1 0
    28 1 0
    29 1 1 should be "29 0 1"
    30 0 1
    31 0 1
    32 0 1
    33 0 1
    34 0 1
    35 0 1
    36 0 1
    37 0 0 should be "37 1 0"
    38 0 0 should be "38 1 0"
    39 1 0
    40 1 0
    41 1 1 should be "41 0 1"
    42 1 1 should be "42 0 1"
    43 1 1 should be "43 0 1"
    44 1 1 should be "44 0 1"
    45 1 1 should be "45 0 1"
    46 1 0
    47 1 0
    48 1 0
    49 1 0 
    

    Here is the code:

    let roomTerrain = Game.map.getRoomTerrain(rn)
    console.log(x, roomTerrain.get(x, 0), this.structures.filter(s => s.structureType == STRUCTURE_WALL && s.hits == undefined && s.pos.x == x && s.pos.y == 0).length)
    

    The GUI shows correct: 0_1627297880749_sh3W8N8.png

    Any ideas what I did wrong or if it's a bug?


  • Dev Team

    Try this:

    Game.map.getRoomTerrain('W8N8').get(37,0)
    1
    Game.map.getRoomTerrain('W8N8').get(41,0)
    0
    

    If you have the same results, it's something wrong with your code. Otherwise, please report providing a full version of minimal reproducing code.



  • @myunnamed said in False TERRAIN_MASK_WALL where is ConstructedWall:

    Game.map.getRoomTerrain(rn)

    Obviously I called getRoomTerrain with rn instead of this.name like how I got the ConstructedWall this.structures.filter().

    My bad. I'm really sorry for the false alarm.