#Floorplan Checked Tiles

Issue #30 resolved
HotelZz created an issue

Hi,

Description: The floorplan only say that a floor or something with more 1 tiles = 1 tile

Long Description: The floorplan only say that a floor or something with more 1 tiles = 1 tile -> check the picture

Picture: https://gyazo.com/079e6dbfa35753c524cf904554265cc5

Comments (4)

  1. Steffen Andreas Kloster

    Not sure how Git works, so I won't be able to push anything. But I did come up with a fix for this. Less work for Wesley, if it's up to his standards 8-).

    Changed

    lockedTiles.add(new Tile(iterator.value().getX(), iterator.value().getY(), 0));
    

    To

    if(iterator.value().getRotation() == 0 || iterator.value().getRotation() == 4) {
        for(int y = 0; y < iterator.value().getBaseItem().getLength(); y++) {
            for(int x = 0; x < iterator.value().getBaseItem().getWidth(); x++) {
                lockedTiles.add(new Tile(iterator.value().getX() + x, iterator.value().getY() + y, 0));
            }
        }
    }
    else {
        for(int y = 0; y < iterator.value().getBaseItem().getWidth(); y++) {
            for(int x = 0; x < iterator.value().getBaseItem().getLength(); x++) {
                lockedTiles.add(new Tile(iterator.value().getX() + x, iterator.value().getY() + y, 0));
            }
        }
    }
    
  2. Wesley repo owner

    There is a method in the Pathfinding class that returns all tiles for a an x, y, width, length and rotation.

    Thanks for the suggestion though!

  3. Log in to comment