Hi, I was trying to fix an error in MailAI (several years late).
When running the current version that's available it seems to be running fine at the start.
When running a slightly altered version for testing it throws an error in a part I haven't altered.
It throws 'the index MyRailPF does not exist' when running the code 'local railfinder = MyRailPF();'
When I try looking for MyRailPF() it does not exist anywhere in my .nut files.
I'm pretty sure it is some kind of altered version of the pathfinder.rail but all I have for that is one overridden method in my main.nut
import("Pathfinder.Rail", "RailPathFinder", 1);
class MyRailPathFinder extends RailPathFinder {}
function MyRailPathFinder::_Estimate(cur_tile, cur_direction, goal_tiles, self) {
local est = ::RailPathFinder._Estimate(cur_tile, cur_direction, goal_tiles, self);
return abs(est * 1.3);
}
This is all long ago, and I know I'm providing very little info above. But is there anyone who can direct me as to where to look for info on how to override railpathfinder?
overriding railpathfinder
Moderator: OpenTTD Developers
overriding railpathfinder
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
Re: overriding railpathfinder
Found the problem, because I'm a sloppy non professional programmer my code is spaghetti with bad naming conventions, I renamed the class but forgot to check all places where it is used.
class MyRailPF extends RailPathFinder {} became class MyRailPathFinder extends RailPathFinder {}
class MyRailPF extends RailPathFinder {} became class MyRailPathFinder extends RailPathFinder {}
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
MailAI, a casual postal service for openTTD.
--------------------------------------------------
Who is online
Users browsing this forum: No registered users and 2 guests