News:

Want to praise Simutrans?
Your feedback is important for us ;D.

AIs don't connect station and rail

Started by z9999, April 17, 2009, 12:02:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

Problem was reported at here.
http://forum.simutrans.com/index.php?topic=1904.msg19724#msg19724
Code is written in assert, this will not exec in release version.

ai_goods.cc:620-

// connect to track
ribi1 = ribi_typ(diff1);
assert( welt->lookup_kartenboden(platz1+size1-diff1)->weg_erweitern(track_wt, ribi1) );
ribi1 = ribi_t::rueckwaerts(ribi1);
assert( welt->lookup_kartenboden(platz1+size1)->weg_erweitern(track_wt, ribi1) );
ribi2 = ribi_typ(diff2);
assert( welt->lookup_kartenboden(platz2+size2-diff2)->weg_erweitern(track_wt, ribi2) );
ribi2 = ribi_t::rueckwaerts(ribi2);
assert( welt->lookup_kartenboden(platz2+size2)->weg_erweitern(track_wt, ribi2) );
return true;

gerw

Patch attached. However, weg_erweitern shouldn't fail in this situation.