18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 06:14:58 +01:00

fix(editor): Fields: the edits of a field stick, the natural slopes stay when the formations are laid again, no holes far off or by a missing chunk

The copy of the field the widgets edit is kept while one of them is held, so a drag ends with what it was dragged to. Laying
the formations again keeps the natural shape of the slopes of each. The surfaces of the fields are made as far as the chunks
are drawn, so their holes never show without them; a field over ground with no chunk is made of what has ground, and waits
only for chunks which are in the files but not loaded yet. Outline it again puts the points on the ground and the cut changes
that field. The holes of the fields are marked (254) and giving one back closes only its own, the holes cut by hand stay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
Claude
2026-11-11 11:43:16 +01:00
parent ff5c7467ed
commit db8ea9081f
6 changed files with 136 additions and 27 deletions

View File

@@ -934,6 +934,14 @@ std::size_t editor_mode::nmt_shape_tracks(std::vector<TTrack *> const *Only)
for (auto const &name : gone)
m_streamer.remove_modifier(name);
}
// the natural shape of the slopes made for a formation stays with it when it's laid again
for (auto &modifier : laid)
for (auto const &old : m_streamer.modifiers())
if (old.name == modifier.name)
{
modifier.natural = old.natural;
break;
}
auto const count{laid.size()};
m_streamer.modifiers(std::move(laid));
forget_ground();