When I click on the same powerline tile twice with "remove powerlines" tool, simutrans will freeze.
1. Build powerline
2. Select "remove powerlines" tool
3. Click on powerline twice on the same tile
Result:
Freeze
Thank you for reporting. I will have a look at it today.
Edit: Both of the following patches should fix this issue:
Index: simwerkz.cc
===================================================================
--- simwerkz.cc (revision 2534)
+++ simwerkz.cc (working copy)
@@ -1708,7 +1708,7 @@
}
else {
leitung_t *lt = gr->get_leitung();
- if( (rem<->get_ribi())==0 ) {
+ if( lt && (rem<->get_ribi()) == 0 ) {
// remove only single connections
lt->entferne(sp);
delete lt;
Index: dataobj/route.cc
===================================================================
--- dataobj/route.cc (revision 2534)
+++ dataobj/route.cc (working copy)
@@ -78,9 +78,6 @@
while( route.get_count()>1 && route[route.get_count()-1] == route[route.get_count()-2] ) {
route.remove_at(route.get_count()-1);
}
- if( route.empty() || k != route.back() ) {
- route.append(k);
- }
route.append(k); // the last is always double
}