mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 13:19:17 +01:00
fix(track): a tributary loads as a river of its first path keeping the second, a track of an unknown type is left out, where both made the simulator fall over as it loaded
On master neither got a segment: update_location() dereferenced the missing one of a track of an unknown type, and a tributary went to Switch(0), which logged "Cannot switch normal track", with no segment under it either. A tributary is now a river of its first path. Its second path is kept in m_paths, isn't drawn nor run on, and is written back with the type "tributary". A track of an unknown type is logged and left out by the loader; as it is no node, its text stays in the file when the editor saves the scenery.
This commit is contained in:
@@ -187,6 +187,7 @@ public:
|
||||
|
||||
std::vector<segment_data> m_paths; // source data for owned paths
|
||||
bool m_editorremoved { false };
|
||||
bool m_tributary { false }; // loaded as a tributary: a river of its first path, the second one kept to be written back
|
||||
scene::basic_node *m_road { nullptr }; // road or road junction which generated this path. such path is one-way, and isn't saved nor edited on its own
|
||||
std::array<float, 3> m_routeweights { 0.f, 0.f, 0.f }; // odds of each route through a crossroads being picked by a driver, by the number of the route. all zero: even odds
|
||||
int iterate_stamp = 0;
|
||||
|
||||
Reference in New Issue
Block a user