I have run into inconsistencies when obtaining the values "wait" from "is_schedule_allowed", for example if the interval entered is "10570", the value obtained from "schedule.entries [nr] .wait" is "127" for some reason. :o
Was this after saving? Simutrans cannot save these values yet.
no need to save, apparently you never get the correct values.
Sorry, then I do not get you error message. So you assign wait a value, which is changed?
Quote from: prissi on April 13, 2021, 07:06:36 AMSorry, then I do not get you error message. So you assign wait a value, which is changed?
I leave you a minimum script to do tests, you just have to create an "Individual Schedule" and put a time interval like "2114", you will see a warning message like "Wait Time: 66 Name: Albacete - Stop Gas Station" Where wait time is the interval obtained from the schedule using script.
local entrie = schedule.entries[0]
if(entrie.wait){
local halt = entrie.get_halt( player_x(pl) )
if (halt)
return "Wait Time: "+entrie.wait+" Name: "+halt.get_name()+""
}
in api_schedule.cc (lines 67/68) the wait-parameter is read as signed 8 bit number, thus the truncation. Should be changed to uint16.
Quote from: Dwachs on April 13, 2021, 12:48:27 PM
in api_schedule.cc (lines 67/68) the wait-parameter is read as signed 8 bit number, thus the truncation. Should be changed to uint16.
I'm going to try as soon as I get home. ;)
should be fixed now
Quote from: Dwachs on April 13, 2021, 12:48:27 PMin api_schedule.cc (lines 67/68) the wait-parameter is read as signed 8 bit number, thus the truncation. Should be changed to uint16.
Unfortunately, this does not solve the problem. :-[
Some more functions still use uint8. Did not see this.
@Dwachs
see https://www.simutrans-forum.de/mybb/showthread.php?tid=9379&pid=119556#pid119556 (https://www.simutrans-forum.de/mybb/showthread.php?tid=9379&pid=119556#pid119556)
please try with r9733 again
It works fine now, thank you very much! :)