18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 10:05:23 +01:00

fix(files): a new layer isn't made over a file there in another case, and the review's smaller points

- node_layers::create() refuses a name a file is there with in any case: on Linux path() wrote over it.
- A name is marked as logged only once the file is known to be there.
- The log line says the file is on disk in another case; the folders FileOnDiskToWrite() looks up aren't logged.
- The editor start reads the layers, and the heightmap terrain its terrain.yaml and pack files, as they're named on the disk.
- The write test compares the names exactly; a test of the log line once per name, with the lines kept by the test log stub.
This commit is contained in:
jerrrrycho
2026-11-24 17:53:46 +01:00
parent 40cc6a2c93
commit 67a7e3876c
6 changed files with 102 additions and 21 deletions
+2 -1
View File
@@ -8684,7 +8684,8 @@ void editor_mode::starter_trainset(std::vector<std::string> &Trailing)
auto const &layer{scene::Layers.layer(static_cast<scene::layer_handle>(handle))};
if (layer.created)
continue;
std::ifstream input{Global.asCurrentSceneryPath + layer.name, std::ios_base::binary};
// the file as it's named on the disk, as node_layers::path() reads it
std::ifstream input{FileOnDisk(Global.asCurrentSceneryPath + layer.name), std::ios_base::binary};
std::string const content{std::istreambuf_iterator<char>(input), std::istreambuf_iterator<char>()};
if (std::regex_search(content, trainset))
return;