Skip to main content
Topic: 100.0&r2056 - AI try to connect an unable route many times (Read 3482 times) previous topic - next topic

100.0&r2056 - AI try to connect an unable route many times

simutrans 100.0&r2056

AI try to connect an unable route many times, and never try another route.
This problem happens in this case:
- There is "missing" route in the root.
- There isn't any suitable place to make stop.

I made a patch to solve this problem. But I don't know this code is safety or not.

Code: [Select]
Index: simplay.cc
===================================================================
--- simplay.cc (r2056)
+++ simplay.cc (copy)
@@ -2398,6 +2398,10 @@
  }
  // no success at all?
  if(state==NR_BAUE_ROUTE1) {
+ // add to impossible connections
+ forbidden_conections.append( fabconnection_t( start->gib_pos().gib_2d(), ziel->gib_pos().gib_2d(), freight ) );
+ // otherwise it may always try to built the same route!
+ ziel = NULL;
  state = CHECK_CONVOI;
  }
  }


Re: 100.0&r2056 - AI try to connect an unable route many times

Reply #1
FYI: prissi will be back on weekend.
  
***** PAK128 Dev Team - semi-retired*****

Re: 100.0&r2056 - AI try to connect an unable route many times

Reply #2
Added on r2058