Terkhen wrote:I found a crash
Thanks Terkhen.
But I was aware of it already
It is an old one with a new face
See this
I am working on it but I have difficulties to find the right solution.
The problem is in this little piece of code in signal.cpp
Code: Select all
case MP_TUNNELBRIDGE: {
if (GetTileOwner(tile) != owner) continue;
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) continue;
DiagDirection dir = GetTunnelBridgeDirection(tile);
if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole
if (!(flags & SF_TRAIN) && IsTunnelBridgePairWithSignals(tile)) {
if (HasVehicleOnPos(tile, NULL, &TrainOnTunnelBridgeTileEnum)) flags |= SF_TRAIN;
} else {
if (HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) flags |= SF_TRAIN;
}
enterdir = dir;
exitdir = ReverseDiagDir(dir);
tile += TileOffsByDiagDir(exitdir); // just skip to next tile
} else { // NOT incoming from the wormhole!
if (ReverseDiagDir(enterdir) != dir) continue;
if (!(flags & SF_TRAIN) && HasVehicleOnPos(tile, NULL, &TrainOnTileEnum)) {
flags |= SF_TRAIN;
if (IsTunnelBridgePairWithSignals(tile)) continue;
}
tile = GetOtherTunnelBridgeEnd(tile); // just skip to exit tile
enterdir = INVALID_DIAGDIR;
exitdir = INVALID_DIAGDIR;
}
}
break;
Especially this line
Code: Select all
if (IsTunnelBridgePairWithSignals(tile)) continue;
I even found more strange behaviour.
One that could interest the developpers
When I take the signal away here my game goes in a loop

- crs1.png (46.95 KiB) Viewed 6008 times
When I take the signal away here the game throws a assert on line 218 of signal.cpp(adding duplicate data)

- crs2.png (45.48 KiB) Viewed 6013 times
It is very simple to avoid this situation.
Just build signal before closing loop with bridge/tunnel.
As you can see on this screen shot there are no ("real") signals between the two bridges. So this provokes the crash.

Yet a small price to pay for this feature
Unfortunately this issue will have to wait till more time is available for me.
