AIRail::RemoveRailTrack not working on level crossing tiles

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

AIRail::RemoveRailTrack not working on level crossing tiles

Post by Brumi »

Whenever I want to remove a piece of rail track from a level crossing tile, I get the error ERR_PRECONDITION_FAILED.

Code: Select all

if (AIRail.IsLevelCrossingTile(tile)) {
	local track = AIRail.GetRailTracks(tile);
	AIRail.RemoveRailTrack(tile, track);	//ERR_PRECONDITION_FAILED
}
Is it a bug in the API, or am I doing something wrong? ?(
deepblue2k8
Engineer
Engineer
Posts: 44
Joined: 06 Sep 2008 12:41
Location: Hamburg, Germany

Re: AIRail::RemoveRailTrack not working on level crossing tiles

Post by deepblue2k8 »

I had the same problem but neglected to make a post here... :roll:
So I think the error is in the API
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AIRail::RemoveRailTrack not working on level crossing tiles

Post by Yexo »

It was a bug in the API, fixed in r17307. Thanks for reporting it.
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: AIRail::RemoveRailTrack not working on level crossing tiles

Post by Brumi »

OK then, I will use a substitute function until 0.7.3 comes out.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 4 guests