diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index 52df3d4..29f66ff 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp @@ -886,7 +886,7 @@ void Game::Update() { int tile_y = data->world_mouse_y/32; if (sago::tiled::tileInBound(data->gameRegion.world.tm, tile_x, tile_y) && !(data->gameRegion.world.tile_protected(tile_x, tile_y)) ) { - int layer_number = 2; // Do not hardcode + int layer_number = data->gameRegion.world.blockingLayer; uint32_t tile = 0; sago::tiled::setTileOnLayerNumber(data->gameRegion.world.tm, layer_number, tile_x, tile_y, tile); data->gameRegion.liqudHandler["water"].updateFirstTile(data->gameRegion.world.tm, tile_x, tile_y); diff --git a/src/saland/Prefabs.cpp b/src/saland/Prefabs.cpp index 9af87dd..61926e5 100644 --- a/src/saland/Prefabs.cpp +++ b/src/saland/Prefabs.cpp @@ -118,7 +118,12 @@ Prefab getPrefab(const char* name) { return p; } - +void TestApplyPrefab(sago::tiled::TileMap& dest, int destX, int destY) { + if (prefabs.size() == 0) { + return; + } + ApplyPrefab(dest, destX, destY, prefabs.front()); +} void ScanPrefabs(const std::string& filename) { std::string mapFileName = "maps/"+filename+".tmx";