The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: z9999 on October 08, 2008, 08:33:10 pm

Title: 100.0&r2056 - AI try to connect an unable route many times
Post by: z9999 on October 08, 2008, 08:33:10 pm
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;
  }
  }

Title: Re: 100.0&r2056 - AI try to connect an unable route many times
Post by: DirrrtyDirk on October 08, 2008, 09:25:28 pm
FYI: prissi will be back on weekend.
Title: Re: 100.0&r2056 - AI try to connect an unable route many times
Post by: prissi on October 11, 2008, 07:08:05 pm
Added on r2058