Suggestion::AI Debug panel
Posted: 09 Mar 2009 03:37
Yesterday, I've made some misstype in my code. My AI doesn't do any progress without any info on AI Debug Panel.
And then, I tried to restart with ./openttd -d ai=5. Now the console said :
dbg: [ai] ERROR: HasNext() is invalid as Begin() is never called
for me, (maybe other too
) it would be hard to find ( if there are tons of HasNext() statement arround your code
) in wich line of code is that error occured. And it looks like that this kind of error doesn't make the program stop, because the console now full-filled with the above error message.
So, the suggestion is :
1. the error message is included with the line number
2. the error message displayed in the debug panel
The misstyped code is similiar like this (error on line 5)
I'm using r15603, today I'll download r1647 and try with that.
And.. correct me if that was just because my miss understanding of squirrel/API
thanks

And then, I tried to restart with ./openttd -d ai=5. Now the console said :
dbg: [ai] ERROR: HasNext() is invalid as Begin() is never called
for me, (maybe other too


So, the suggestion is :
1. the error message is included with the line number
2. the error message displayed in the debug panel
The misstyped code is similiar like this (error on line 5)
Code: Select all
local list = AIList();
for(local i = list.Begin(); list.HasNext(); i = list.Next()){
//do some stuff
local list2 = AIList();
for(local i = list.Begin(); list2.HasNext(); i = list2.Next()){
//do some stuff that make a further decission
// as the looping is not give the actual value of .Next() , the decission is never made
}
}
And.. correct me if that was just because my miss understanding of squirrel/API

