News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

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

Started by z9999, October 08, 2008, 08:33:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

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.


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;
}
}



DirrrtyDirk

  
***** PAK128 Dev Team - semi-retired*****

prissi