Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI Airports: the "out of range" indexes are marked as available, and can even be built. #7433

Closed
SamuXarick opened this issue Mar 28, 2019 · 3 comments

Comments

@SamuXarick
Copy link
Contributor

SamuXarick commented Mar 28, 2019

Version of OpenTTD

1.9.0-RC2

Expected result

AIs should only build available airport types.

Actual result

the "out of range" indexes are marked as available, and can even be built.

Steps to reproduce

Create an AI with this:

	for (local type = 0; type < 9999; type++) {
		if (AIAirport.IsValidAirportType(type)) {
			local w = AIAirport.GetAirportWidth(type);
			local h = AIAirport.GetAirportHeight(type);
			local r = AIAirport.GetAirportCoverageRadius(type);
			local c = AIAirport.GetMaintenanceCostFactor(type);
			local p = AIAirport.GetPrice(type);
			local i = AIAirport.IsAirportInformationAvailable(type);
			AILog.Info("Type: " + type + "; Width: " + w + "; Height: " + h + "; Radius: " + r + "; MaintenanceCostFactor: " + c + "; Price: " + p + "; IsAirportInformationAvailable: " + i);
		}
	}

Vanilla Airports:
Unnamed, 2051-01-02

OpenGFX+ Airports 0.5.0 Airports:
Unnamed, 2051-01-31

@glx22
Copy link
Contributor

glx22 commented Mar 29, 2019

Following the steps, I can't reproduce in 1.9-RC2.
Without newgrf airports loaded, I get 8 lines, for types 1, 2, 3, 4, 5, 6, 7, 8.
With OpenGFX+ Airports 0.5.0 I get 15 lines, for types 1, 2, 3, 4, 7, 11, 12, 14, 15, 16, 17, 18, 19, 21, 23.
Same with 20190328-master-gacb09eb9a8.

@SamuXarick
Copy link
Contributor Author

do you have airports never expire disabled?

@glx22
Copy link
Contributor

glx22 commented Mar 29, 2019

Indeed it was disabled. When enabled I can reproduce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants