OpenTTD/bin/game/compat_12.nut
Patric Stout f60b3d7f79
Codechange: [Script] rework how compat-scripts work and are loaded (#13504)
- compat_NNN.nut files now only defines what is needed to downgrade from API NNN + 1 to NNN.
- Automatically load all required compatibility files based on the API version of the script, starting with the latest.
2025-02-09 15:04:04 +00:00

21 lines
913 B
Plaintext

/*
* This file is part of OpenTTD.
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
*/
/* This file contains code to downgrade the API from 13 to 12. */
GSRoad._HasRoadType <- GSRoad.HasRoadType;
GSRoad.HasRoadType <- function(tile, road_type)
{
local list = GSRoadTypeList(GSRoad.GetRoadTramType(road_type));
foreach (rt, _ in list) {
if (GSRoad._HasRoadType(tile, rt)) {
return true;
}
}
return false;
}