The International Simutrans Forum

 

Author Topic: 100.0&r2056 - AI try to connect an unable route many times  (Read 2247 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
100.0&r2056 - AI try to connect an unable route many times
« 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;
  }
  }


Offline DirrrtyDirk

  • Devotees (Inactive)
  • *
  • Posts: 1253
  • JR 700 Series Shinkansen
  • Languages: EN,DE
Re: 100.0&r2056 - AI try to connect an unable route many times
« Reply #1 on: October 08, 2008, 09:25:28 PM »
FYI: prissi will be back on weekend.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10636
  • Languages: De,EN,JP
Re: 100.0&r2056 - AI try to connect an unable route many times
« Reply #2 on: October 11, 2008, 07:08:05 PM »
Added on r2058