IRC logs for #openttd on OFTC at 2019-02-06
            
00:05:49 *** HerzogDeXtEr has quit IRC
00:09:14 *** Wolf01 has quit IRC
00:29:04 *** Thedarkb-T60 has quit IRC
00:33:53 <DorpsGek_II> [OpenTTD/OpenTTD] michicc merged pull request #7182: Doc: AAT_STATION_AIRPLANE_LAND triggers only a single tile, not all airport tiles. #7181 https://git.io/fh9Ly
00:49:38 *** Thedarkb-T60 has joined #openttd
01:27:11 *** supermop_work_ has quit IRC
01:54:23 <Samu> silent
02:00:19 <Pikka> shhh
02:24:43 *** Thedarkb-X40 has joined #openttd
02:31:32 *** Thedarkb-T60 has quit IRC
03:15:52 *** Wormnest has joined #openttd
03:25:45 *** Wormnest has quit IRC
04:38:36 *** D-HUND has joined #openttd
04:41:59 *** debdog has quit IRC
04:45:48 *** Samu has quit IRC
04:46:19 *** Thedarkb-X40 has quit IRC
04:52:37 *** glx has quit IRC
06:54:33 *** keoz has joined #openttd
07:57:11 *** andythenorth has joined #openttd
08:12:44 <andythenorth> moin
08:16:34 *** keoz has quit IRC
08:20:10 *** sla_ro|master has joined #openttd
08:40:59 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN merged pull request #7118: Add #5006: Flag to hide rail type from construction. https://git.io/fh6Vk
08:46:47 <andythenorth> \o/
08:46:56 <andythenorth> now how can I abuse that? :D
08:47:07 <andythenorth> universal rail vehicle? o_O
08:47:30 <planetmaker> Moin. That existed before :)
08:47:37 <planetmaker> To the dismay of some other authors :P
08:48:22 <andythenorth> hmm, can I connect NG to RAIL, and have a vehicle go between them?
08:48:41 <planetmaker> label is label. If a vehicle says it can run on both: fine
08:48:59 <peter1138> You can now do it the other way.
08:49:14 <peter1138> Universal rail type that is compatible with everything.
08:49:24 <peter1138> Hmm, no
08:49:26 <peter1138> Wait
08:49:33 <peter1138> Yeah that was the oroginal way
08:49:44 <andythenorth> yeah
08:49:44 <peter1138> I dunno :p
08:49:54 <andythenorth> one day we'll have a spec :D
08:50:05 <peter1138> Yeah I need to update the wiki. Where is the wiki?
08:50:21 <andythenorth> https://newgrf-specs.tt-wiki.net/wiki/Action0/Vehicles/Trains#Track_type_.2805.29
08:50:22 <andythenorth> and stuff
08:50:24 <planetmaker> There definitely should be an OpenTTD 1.10 next year. Not 2.0 ;)
08:50:30 <andythenorth> you probably want the railtypes page
08:50:37 <andythenorth> not the vehicle track type page
08:50:53 <andythenorth> it's nice that they're different
08:50:54 <peter1138> planetmaker, we should never do 2.0 :-)
08:51:11 <andythenorth> I think we should keep the threat of 2.0 alive
08:51:19 <peter1138> Hmm, needs a login to edit.
08:51:23 <andythenorth> oof
08:51:26 <andythenorth> forums login should do it
08:51:28 <peter1138> Is it the same as the other logins or separate?
08:51:35 <andythenorth> should be same as forums, but it breaks sometimes
08:51:46 <andythenorth> I couldn't edit for ~2 years, then I could
08:52:19 <peter1138> " Auto-creation of a local account failed: Automatic account creation is not allowed. "
08:52:22 <peter1138> Hmm, well.
08:52:44 <peter1138> So, er, can someone else add it? :p
08:52:44 <andythenorth> yeah for 2 years I had to request edits via forum threads
08:53:06 <peter1138> Is it orudge who looks are that site?
08:53:33 <andythenorth> I don't thnk anyone looks after it afaict
08:54:15 <peter1138> Somebody hosts it and set that account linking up.
08:55:41 <andythenorth> yes, I don't even know if that one's on ottd or coop hosting though
08:56:00 <andythenorth> I know that getting anybody to answer questions about it is ~impossible
08:56:33 *** m3henry has joined #openttd
08:56:51 * andythenorth wonders about sacking that wiki
08:57:02 <andythenorth> and distributing the docs with nml or grfcodec using readthedocs
08:58:31 <peter1138> No, it's a useful reference.
08:58:47 <peter1138> github :p
08:59:27 <andythenorth> yeah, AIUI, readthedocs just publishes from a github repo, and edits are via PR
08:59:38 <andythenorth> and we have one less web service to run
09:00:58 <andythenorth> oof I have to go in the office for Risk Register meeting
09:01:09 <andythenorth> much rather stay at home and make enterprise software
09:01:33 <peter1138> Hmm, I need to change my tt-forums password.
09:02:21 <peter1138> "Must be between 6 characters and 30 characters."
09:02:23 <m3henry> Is the wiki difficult to maintain?
09:02:25 <peter1138> Limits, lol
09:02:31 <m3henry> 123qwe
09:02:33 *** m3henry has quit IRC
09:04:28 *** m3henry has joined #openttd
09:04:30 <andythenorth> nobody knows if the wiki is difficult to maintain :P
09:04:44 <andythenorth> I think frosch has tried to keep the lights on for it sometime
09:05:33 <peter1138> In my experience once installed they generally just run by themselves. Moderators deal with junk edits.
09:06:08 *** m3henry has quit IRC
09:06:28 <peter1138> Of course, it's likely to be out of date, security patch wise.
09:07:31 <andythenorth> it would be nice to make newgrf less generally shit to develop for
09:07:37 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on issue #5006: Railtypes: 'hide railtype' flag https://git.io/fh9z0
09:07:38 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN closed issue #5006: Railtypes: 'hide railtype' flag https://git.io/fh9zE
09:07:40 <andythenorth> it's kinda un-fun right now
09:07:50 <peter1138> Okay, I must remember to squash and retitle commits to include the PR :/
09:08:00 <andythenorth> remember that
09:08:18 *** m3henry has joined #openttd
09:09:48 *** m3henry has joined #openttd
09:09:53 <m3henry> Would having to raise a PR discourage users from editing?
09:10:40 *** m3henry has quit IRC
09:11:46 *** m3henry has joined #openttd
09:11:50 <m3henry> Phone is not the best IRC client :v
09:11:52 <peter1138> Probably.
09:12:24 <Eddi|zuHause> <m3henry> Would having to raise a PR discourage users from editing? <-- almost definitely
09:12:26 <andythenorth> I wondered
09:12:30 <andythenorth> but compared to this?
09:12:31 <andythenorth> https://www.tt-forums.net/viewtopic.php?f=68&t=74378
09:12:32 <Eddi|zuHause> but so would not being able to make an account
09:13:02 <andythenorth> from 2016-2018 I could only edit via request in forums
09:13:10 <andythenorth> and nobody gave a fuck to fix it
09:13:16 <andythenorth> and I made new accounts that also don't work
09:13:35 <andythenorth> so eh, yeah, I'm somewhat biased agains the wiki
09:13:50 *** m3henry has quit IRC
09:14:06 <andythenorth> standard example of 'we must do it this way, it's the most technically correct'
09:14:08 <andythenorth> but also broken
09:14:43 <andythenorth> :D
09:15:39 *** m3henry has joined #openttd
09:15:40 <andythenorth> oh George has done AC-DC engines
09:16:25 <peter1138> Yes.
09:18:47 *** m3henry has quit IRC
09:22:21 <andythenorth> nice use of the feature
09:23:50 * andythenorth must finish Horse, then make an NRT grf
09:27:14 *** andythenorth has quit IRC
09:47:02 *** tokai has quit IRC
09:55:59 <Eddi|zuHause> <peter1138> "Must be between 6 characters and 30 characters." <-- what? you can't have the entirety of "war and peace" as your password?
09:57:31 *** andythenorth has joined #openttd
10:03:55 <peter1138> Sadly not.
10:16:25 <peter1138> Bah, my password DB is not synced :/
11:32:53 *** andythenorth has left #openttd
11:37:35 <DorpsGek_II> [OpenTTD/OpenTTD] andythenorth commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9af
11:44:45 *** sla_ro|master has quit IRC
11:55:31 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9a2
12:00:36 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9a6
12:44:07 *** m3henry has joined #openttd
12:47:49 *** keoz has joined #openttd
13:02:04 <peter1138> Hmm, need a matrix with lowered entries :/
13:02:51 <peter1138> Or... inheritence and custom drawing, maybe.
13:06:55 *** supermop_Home has joined #openttd
13:36:09 <supermop_Home> Pikka is new tai just the color wireframe shapes for now?
13:53:05 *** m3henry has quit IRC
13:53:49 <peter1138> supermop_Home, yes
14:02:56 <Eddi|zuHause> is that an upgrade or downgrade from flat scrabble tiles?
14:09:31 <peter1138> Ok, the chocolate cake is now gone.
14:16:03 <Eddi|zuHause> how dares it
14:17:35 *** Flygon has quit IRC
14:37:19 *** Samu has joined #openttd
14:37:22 <Samu> hi
14:39:59 <Samu> what is pikka's basic industries named?
14:46:39 <Samu> round-robin too hard for my understanding
14:55:07 *** supermop_work has joined #openttd
14:56:24 *** supermop_work_ has joined #openttd
14:57:52 <supermop_work_> yo
15:01:38 <supermop_work_> @logs
15:01:38 <DorpsGek> supermop_work_: https://webster.openttdcoop.org/index.php?channel=openttd
15:01:57 <Samu> google is useless https://www.youtube.com/watch?v=b-hnwVKN-kE
15:02:53 <Samu> all i can find is cpu scheduling
15:03:00 <Samu> not helpful
15:03:27 <Samu> and round robin tournaments
15:04:11 *** supermop_work has quit IRC
15:04:20 <LordAro> the fact that it's on a cpu is irrelevant, use it
15:06:02 <Samu> I don't see the connection
15:08:24 <Samu> i'm not dealing with time
15:08:28 <Samu> I don't get it
15:08:56 <LordAro> you can treat time as just a other resource
15:18:04 <Samu> i don't get it
15:19:21 <Samu> dont know what round robin is nor what is supposed to do in this case
15:19:36 <Samu> i send 1 piece of cargo to an industry at random
15:19:49 <Samu> sometimes there's less cargo than industries
15:20:45 <Samu> if I send it in turns, some industries get 0
15:21:07 <Samu> if I send it at random, there's a chance every industry get it
15:21:50 <Samu> cargo packets fragmentates amounts in many small pieces
15:21:54 <Samu> usually 5
15:22:01 <Samu> depending on vehicle
15:22:44 <Samu> ships get 20 at times
15:23:02 <Samu> trains and road vehicles get 5
15:23:12 <Samu> and unsure about aircraft
15:24:46 <Samu> cargo age may also dictate how many pieces are in a packet
15:24:58 *** tokai has joined #openttd
15:24:58 *** ChanServ sets mode: +v tokai
15:25:28 <Samu> can fragment 1 packet of 5 pieces into up to 5 packets
15:25:43 <Samu> then that function is only distributing 1 piece
15:25:55 <Samu> distributing at random was the best solution I could find
15:26:01 <Samu> avoids save game conversion
15:26:13 <Samu> avoids some industries getting more than the others
15:26:21 <Samu> avoids "bias"
15:27:39 <Samu> round robin, no idea what would it do here
15:29:53 <Samu> there was some other different implementation by someone
15:30:14 <Samu> which requires savegame conversion, saving the data into the save for sync
15:30:22 <Samu> let me find
15:33:47 <Samu> https://www.tt-forums.net/viewtopic.php?f=33&t=77093#p1192630
15:39:32 <DorpsGek_II> [OpenTTD/OpenTTD] btzy commented on pull request #7005: Fix #7004: Redraw linkgraph overlay correctly after zoom https://git.io/fh9oa
15:41:32 <Samu> where do I get Pikka's Basic Industries grf
15:43:02 *** nielsm has joined #openttd
15:43:16 *** sla_ro|master has joined #openttd
15:44:36 <Samu> Is it Tal Industries?
15:49:54 <Samu> bah i always get a crash in debug mode when i download something from bananas
15:50:29 <nielsm> well, crash where?
15:50:47 <Samu> when exiting openttd
15:52:19 <Samu> https://paste.openttdcoop.org/pzifimxjz
15:56:03 <Samu> launch openttd
15:56:07 <Samu> check online content
15:56:12 <Samu> download something
15:56:16 <Samu> exit openttd
15:56:17 <Samu> crash
15:57:08 <Samu> --------------------------- Microsoft Visual C++ Runtime Library --------------------------- Debug Assertion Failed! Program: ...OpenTTD GitHub\OpenTTD\projects\..\objs\x64\Debug\openttd.exe File: minkernel\crts\ucrt\src\appcrt\lowio\close.cpp Line: 49 Expression: (_osfile(fh) & FOPEN) For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts. (Press Retry to debug the application) -------
16:02:36 <peter1138> it's TaI Town.
16:04:15 <nielsm> yeah that's saying it's trying to close a file twice
16:04:25 <nielsm> what is trying to close what file?
16:04:37 <peter1138> "download something from bananas"
16:04:38 <peter1138> Hmm
16:05:13 <Samu> tick some content to download, download it
16:05:21 <Samu> then exit
16:06:10 <nielsm> it's a stdio handle it's trying to close
16:06:41 <nielsm> https://0x0.st/zsxY.png
16:08:42 <nielsm> oh well actually just closing all file handles opened with stdio.h
16:09:48 <peter1138> So closing an already closed file is an issue, I suppose.
16:09:54 <nielsm> indicating something is closing file handles behind its back
16:12:43 *** octernion has joined #openttd
16:24:10 <LordAro> windows specific?
16:28:01 *** Wormnest has joined #openttd
16:29:53 *** cHawk has joined #openttd
16:31:27 <nielsm> unknown, but may also be a problem on other platforms
16:31:50 <nielsm> I'm not sure how to approach debugging this
16:34:47 <peter1138> Add a wrapper around fclose :/
16:39:10 *** Thedarkb-T60 has joined #openttd
16:41:05 <Samu> about industry stopping acceptance
16:41:18 <Samu> it's handled
16:41:47 <Samu> if every industry is rejecting, the while loop returns false
16:42:39 <Samu> if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) { rejected.Include(ind);
16:43:11 <Samu> } while (num_pieces != 0 && rejected.Length() != st->industries_near.Length());
16:43:36 <Samu> if all are rejecting, then rejected.Length will equal industries_near.Length
16:43:42 <Samu> the loop breaks
16:44:12 <Samu> i don't think an infinite loop will happen
16:46:29 <peter1138> What are you refering to?
16:46:37 <Samu> andythenorth
16:47:32 <peter1138> I don't see him saying anything about infinite loops.
16:47:32 <Samu> just tested pikka's grf
16:48:19 <Samu> what is he referring to then
16:49:18 <Samu> the tiles themselves stopping acceptance
16:49:49 <peter1138> He just says there may be bugs to take care of.
16:50:02 <peter1138> He doesn't say "this stuff happens so you'll have an infinite loop"
16:51:50 <Samu> st->always_accepted ?
16:52:15 <peter1138> He doesn't refer to anything specific.
16:52:33 <Samu> yeah, I have to guess
16:53:36 <Samu> the part I'm touching is just the industry, the industry tiles are handled elsewhere, and I didn't touch it
16:54:06 <peter1138> Nothing about guessing.
16:54:06 <Samu> unless he refers to my other PR
16:54:16 <peter1138> It's about making a note that things need to be fully tested, not just "i ran it and it's okay"
17:02:07 <Samu> dont know how to implement the robin-hood thing
17:02:13 <peter1138> robin-hood lol
17:02:18 <Samu> round-robin
17:05:42 <nielsm> many files are opened and closed, certainly...
17:05:46 <peter1138> Yup
17:06:32 *** Thedarkb-T60 has quit IRC
17:06:39 <peter1138> Samu, basically instead of using random, use a counter.
17:07:06 <peter1138> Store that counter inside the station struct.
17:07:10 <peter1138> (And it needs to be saved)
17:07:41 <peter1138> When you come to deliver cargo, it will be given to the next nearby industry as indicated by the counter, instead of a random one.
17:08:22 <peter1138> You may want a separate counter per cargo type.
17:08:24 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9lr
17:08:40 <peter1138> (And it needs bounds checking in case industries are added to removed)
17:09:42 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh96i
17:11:10 <nielsm> why must openening the online content browser open/close a zillion files?
17:11:46 <peter1138> Does it check what's available locally?
17:13:01 <nielsm> yeah, it seems to be checking locally available files very muchj
17:13:04 *** Thedarkb-T60 has joined #openttd
17:29:08 <nielsm> hmm... https://0x0.st/zs3T.txt
17:29:32 <nielsm> that's from downloading the new content to pressing Exit and getting the assert
17:30:12 <nielsm> (nothing happens if you get the list of content available and do not download any new items, so didn't start logging until just before clicking Download)
17:34:26 <nielsm> okay, turns out it's actually the very first stream it attempts to close in the stdio shutdown that fails here, everything before it is called from ottd code or freetype code
17:35:34 *** Gja has joined #openttd
17:36:58 <Samu> the amount could be 0 if the industry doesn't want to process more cargo, not sure, have to recheck
17:37:16 <Samu> industry is full
17:40:28 *** octernio_ has joined #openttd
17:40:57 *** octernion has quit IRC
17:42:10 <nielsm> ahh, I have a suspicion on the fclose assert
17:42:56 <Samu> GetStockpiledCargo
17:42:56 <nielsm> might be related to gzopen/gzclose, those seem to not use fopen/fclose with FILE* streams but open/close with os handles
17:43:57 <Samu> i guess the max stockpiled cargo could be 65535 :P
17:44:12 <Samu> need to test this better
17:52:23 <peter1138> Samu, when could "min(1, xxx)" ever be less than 1?
17:52:59 <Samu> when stockpilled cargo is 65535, if that is even possible, i'm checking
17:53:33 <peter1138> How so?
17:54:13 <nielsm> why... why is zlib K&R C
17:54:14 <Samu> i think a way to force this test would be to have a cargo packet of 65535 units
17:55:00 <peter1138> Samu, oh fudge, ignore me, I confused max and min :p
17:55:04 <Samu> have a vehicle unload 65535 at a time
17:55:22 <peter1138> Deleted comment.
17:55:35 <Samu> ok :|
18:05:42 *** Progman has joined #openttd
18:08:10 <LordAro> nielsm: ha
18:08:30 <LordAro> presumably because it has to be compatible with *everything*
18:08:42 <LordAro> or just because it's ancient
18:10:03 <nielsm> anyway I should probably make a test case that tries to gzopen("file.gz", "r"); gzclose(fh); fopen("file", "r"); fclose(fp);
18:10:05 <peter1138> Definitelky just ancient.
18:10:13 <nielsm> such that the two would use the same file handle in the stdlib
18:10:19 <nielsm> then see if it triggers the bug
18:10:32 <nielsm> because I'm really not sure why else it would fail like this
18:17:30 *** synchris has joined #openttd
18:22:34 <Pikka> yo
18:27:36 *** supermop_work_ has quit IRC
18:29:14 <peter1138> Hi
18:36:52 <nielsm> what it looks like is happening is that someone/something is doing the equivalent of FILE *fh = fopen(...); close(fileno(fh)); and leaving the FILE* dangling
18:40:50 <Samu> testing copper mill
18:41:28 <Samu> maximum copper that is stockpilled is said to be 1000, but it only starts rejecting at 1001
18:41:37 <Samu> intended or bug?
18:42:37 <Samu> if (IndustryTemporarilyRefusesCargo(ind, cargo_type)) { came out false and was already at 1000
18:43:07 <Samu> this goes into newgrf code which is a complete mess for me
18:43:19 <Samu> scope resolvers, callbacks, hex numbers, mess!
18:44:09 <peter1138> You don't need to care about that.
18:45:55 <peter1138> You only care if it's rejected or not.
18:48:38 <Samu> pikka is the author?
18:49:35 <Samu> it looks wrong imo
18:49:40 <Samu> if it's 1000, it's not 1001
18:51:18 <Samu> who's at fault here? newgrf author or openttd code?
18:52:44 <Pikka> neither?
18:54:40 <Pikka> afaia the opt out of accepting cargo callback either accepts a cargo unload or doesn't. accepting part of the unload up to a limit isn't an option.
18:55:12 <Pikka> I guess if there's a "fault" it's in my description of the limit.
18:55:20 <Samu> but it's unloading 1 piece at a time
18:55:35 <Samu> didn't stop at 1000
18:56:22 <Pikka> then I guess it's off by one in the grf
18:57:10 <Samu> if (HasBit(indspec->callback_mask, CBM_IND_REFUSE_CARGO))
18:57:15 <Samu> this is hard to follow :|
18:58:04 <Samu> GetIndustryCallback(CBID_INDUSTRY_REFUSE_CARGO, 0, indspec->grf_prop.grffile->cargo_map[cargo_type], ind, ind->type, ind->location.tile);
19:02:18 <Samu> returns 0
19:02:27 <Samu> when it's already at 1001
19:06:16 <peter1138> So?
19:06:20 <peter1138> That's not your problem.
19:06:34 <peter1138> You only care that it refuses or doesn't refuse.
19:06:40 <peter1138> Beyond that callback is not your concern.
19:06:45 <Samu> i want to be sure it's not openttd problem
19:07:52 <nielsm> if the GRF callback evaluation engine mis-evaluated this, it would be a grave error that would mean every NewGRF using callbacks would fail in strange ways
19:07:58 <nielsm> and they are not all failing
19:08:07 <nielsm> hence it's a problem with the specific GRF in question
19:09:29 *** Wolf01 has joined #openttd
19:11:41 *** HerzogDeXtEr has joined #openttd
19:12:19 <nielsm> hmm yeah, GunzipFile in network_content.cpp does do some suspicious things with mixing fopen and gzclose
19:19:52 <Wolf01> o/
19:20:28 <nielsm> ahh, nice, it's a 10 year old bug: https://github.com/OpenTTD/OpenTTD/commit/fdc2e851840f919f71b7cdad328511600c7fe535
19:20:48 <nielsm> well, 9 years and 15 days
19:20:57 <nielsm> uh 9 years and 350 days
19:21:46 *** supermop_work has joined #openttd
19:22:31 *** gelignite has joined #openttd
19:23:05 <LordAro> nice
19:23:41 <peter1138> gzclose already closes it, right?
19:23:43 *** supermop_work_ has joined #openttd
19:23:53 <nielsm> gzclose closes the file handle
19:23:57 <nielsm> not the FILE* object
19:24:06 <peter1138> Hmm.
19:24:20 <nielsm> this leaves a FILE* object hanging around the stdio library with an invalid OS file handle
19:24:32 <nielsm> and that's why it asserts during shutdown
19:26:57 <peter1138> Hmmm why is my widget the wrong height :s
19:27:22 <nielsm> either the fopen() on the input file needs to be replaced with _open(), or somehow the FILE* object needs to be destroyed without closing the file handle
19:29:40 <peter1138> " If you are using fileno() to get the file descriptor from a FILE *, then you will have to use dup() to avoid double-close()ing the file descriptor."
19:29:51 *** supermop_work has quit IRC
19:29:51 <nielsm> ahh
19:29:58 <peter1138> ^ in the zlib docs.
19:30:07 <peter1138> dup(fileno()) ?
19:34:24 *** Thedarkb-T60 has quit IRC
19:34:51 *** Wormnest has quit IRC
19:36:17 *** Thedarkb-T60 has joined #openttd
19:37:48 <Samu> return min(this->industry->incoming_cargo_waiting[variable - 0x40], (uint16)0xFFFF);
19:37:59 <Samu> min(1000, 65535)
19:38:03 <Samu> hmm
19:38:13 <nielsm> pointless, Samu
19:38:20 <nielsm> since incoming_cargo_waiting is uint16
19:38:47 <nielsm> 0xFFFF is its max value, the first argument to min() can never be larger than the second
19:42:58 <nielsm> grmblkdsofjsodfsbfsr5
19:43:11 <nielsm> WSL session has lost its network ability again
19:43:52 <Samu> if (this->ranges[i].low <= value && value <= this->ranges[i].high) {
19:44:01 <Samu> .low is 0
19:44:05 <Samu> .high is 1000
19:44:24 <peter1138> Well then.
19:44:36 <peter1138> 18:06 <@peter1138> That's not your problem.
19:44:55 *** andythenorth has joined #openttd
19:45:11 <andythenorth> o/
19:48:28 <DorpsGek_II> [OpenTTD/OpenTTD] andythenorth commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh91G
19:48:38 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91Z
19:48:57 *** Progman has quit IRC
19:49:46 <nielsm> I hope the code is not too fancy :P
19:49:47 *** Progman has joined #openttd
19:49:52 <Samu> hmm
19:50:00 <supermop_work_> hi andythenorth
19:50:04 <andythenorth> lo supermop_work_
19:50:10 <Samu> i think Pikka needs to change something on the grf side
19:50:16 <Samu> that makes .high to be 999
19:50:19 <Samu> not 1000
19:50:36 <Samu> which is kinda weird
19:50:45 <Samu> 999 means 1000 in this case
19:51:10 <nielsm> "the largest stockpile where you will still accept more cargo"
19:51:54 <Samu> oh, where did u find that
19:52:12 <nielsm> nowhere
19:52:13 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91B
19:52:15 <nielsm> I just typed it
19:53:56 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh commented on pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91u
19:54:18 * andythenorth has been busy brexit planning
19:55:03 <peter1138> andythenorth, phew, nobody else has.
19:57:04 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro commented on pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91V
19:58:07 <andythenorth> peter1138: I'm getting customer questions about it
19:58:13 <andythenorth> I had to assess supply chain disruptions
19:58:32 <andythenorth> so I had a look at the electricity interconnects between UK, and European mainland
19:58:41 <andythenorth> also the island of Ireland, both political parts
19:58:57 <andythenorth> also we kind of need to know if there will be food in the ships
19:59:02 <andythenorth> or shops :P
19:59:11 <andythenorth> but the typo is probably equally accurate there
19:59:30 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh updated pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91Z
19:59:43 <andythenorth> the thing is, the customer is one of the organisations we're relying on to ensure there's food in the shops
19:59:47 <andythenorth> so it's a bit circular
19:59:50 <andythenorth> 'you tell us'
19:59:54 <andythenorth> 'no you'
19:59:56 <andythenorth> 'no you'
20:00:06 <andythenorth> such lolz
20:00:19 <LordAro> sounds about right
20:03:33 <andythenorth> so how many PRs are left?
20:03:41 <Samu> what does the documentation say, if there's any
20:03:45 <Samu> newgrf doc
20:04:08 <Samu> nielsm: was it documented?
20:05:57 <nielsm> I don't know
20:06:36 <peter1138> nielsm, looks better
20:06:37 <nielsm> is it this one? https://newgrf-specs.tt-wiki.net/wiki/Callbacks#Opt_out_of_accepting_cargo_.283D.29
20:06:59 <nielsm> because it documents that the callback must return 0 or 1 to indicate whether the cargo is accepted
20:07:16 <nielsm> and nothing about how it can reach that return value
20:07:29 <nielsm> except presumably do some range checks of its stockpile variables
20:08:10 *** m3henry has joined #openttd
20:08:33 <Samu> it's 0x40
20:08:35 <andythenorth> I read the logs, PBI is probably just an obiwan by pikka in nfo
20:08:37 <Samu> whatever it is
20:08:43 <andythenorth> or it's integer maths
20:08:46 *** Progman has quit IRC
20:09:07 <andythenorth> classic derailment :)
20:09:09 *** Thedarkb-T60 has quit IRC
20:09:33 <nielsm> there is no callback 0x40
20:11:09 <Samu> uhm..
20:11:47 <Samu> 61?
20:11:53 <Samu> in hex
20:11:56 <Samu> it's something else
20:12:15 <Samu> 3D
20:13:10 <nielsm> 3D is exactly the one I linked
20:13:37 <Samu> looks like it
20:13:45 <nielsm> and the minimum and maximum in action 2 switches are inclusive, exactly as defined
20:14:09 <nielsm> https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2
20:15:21 <nielsm> so if the callback is defined as checking the industry variable for stockpiled cargo against range 0 to 1000, and return 1 if it is in that range, then yes it works exactly as designed
20:15:35 <nielsm> and a stockpile equal to 1000 will mean it accepts
20:16:41 <Samu> Maximum (inclusive) of the range I see
20:17:34 *** frosch123 has joined #openttd
20:17:47 <Samu> then there's nothing to do on openttd side :)
20:17:58 <Samu> it's newgrf's fault
20:18:01 <Samu> or design
20:18:18 <nielsm> yes, you have reached the conclusion that callback resolution in openttd does indeed work
20:19:05 <nielsm> imagine if the only reason it had worked for the past 10 (?) years was because everyone believed it should work, and it would have stopped working the instant you discovered it was supposed not to
20:19:37 <andythenorth> nielsm that's a bit quantum information :P
20:20:10 <andythenorth> also what am I doing?
20:20:19 <Samu> the thing only returns 1 or 0, can't even compare amounts
20:20:20 <andythenorth> diligently working on Horse issues for a Beta?
20:20:30 *** Progman has joined #openttd
20:20:32 <andythenorth> playing tanks?
20:20:46 <andythenorth> figuring out why extending newgrf sucks so much, and persuading us to fix it?
20:20:54 *** supermop_work has joined #openttd
20:22:37 *** supermop_work__ has joined #openttd
20:25:39 <nielsm> and btw Samu, thanks for noticing that this assert failure on exit happened specifically when you had downloaded content and not in other situations
20:25:49 <nielsm> it was a big help in tracing down the root cause
20:25:59 <Samu> oh, really? well no problem
20:27:19 *** Gja has quit IRC
20:28:15 <Samu> it was happening since ever I started messing with virtual studio
20:28:41 *** supermop_work_ has quit IRC
20:28:48 <Samu> visual* studio
20:29:23 <nielsm> I'm guessing lots of people have encountered it since the bug was introduced but nobody noticed the cause before
20:29:57 *** supermop_work has quit IRC
20:31:12 <Samu> andythenorth, it doesn't need savegame conversion if it's implemented like this
20:31:24 <Samu> but if you want to add an option, then yes, it needs
20:32:03 *** supermop_work has joined #openttd
20:33:18 *** supermop_work_ has joined #openttd
20:38:26 *** Progman has quit IRC
20:39:01 *** supermop_work__ has quit IRC
20:39:18 *** Progman has joined #openttd
20:40:06 *** supermop_work has quit IRC
20:50:26 <Samu> and if you want a savegame conversion, I guess that also means you want the robin-round thing
20:50:32 <Samu> :|
20:52:33 <peter1138> Samu, 19:20 < Samu> the thing only returns 1 or 0, can't even compare amounts
20:52:46 <peter1138> Samu, yeah, that's the point of callbacks. It's the NewGRF's job to do the comparing :-)
20:53:14 <peter1138> round-robin would be more deterministic, which might be better.
20:53:34 <peter1138> Might be wasteful of space, though.
20:54:09 <Samu> isn't random also deterministic
20:54:33 <Samu> pseudo-random or so
20:55:09 <Samu> i tested in a network game, it doesn't desync
20:55:36 <Samu> let me test again, I guess, things may have changed since back then
20:58:12 *** supermop_work has joined #openttd
20:58:39 <peter1138> Yes but...
20:58:49 <peter1138> Hmm, how do you the weighting?
20:59:09 <Samu> the what?
20:59:37 *** HerzogDeXtEr has quit IRC
20:59:51 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN opened pull request #7186: Fix #7108: Missed generate_widget script run for livery changes. https://git.io/fh9Mj
20:59:51 *** supermop_work__ has joined #openttd
21:00:13 <peter1138> "it splits to all nearby stations, while still considering station rating from highest to lowest"
21:00:33 <Samu> that's not industry
21:00:35 <peter1138> Oh right, that's station rating, there's no such thing as industry rating :-)
21:01:20 <Samu> of, that's the weighting?
21:01:33 <Samu> could be based on industry proximity to station
21:01:44 <Samu> but currently it's just random
21:01:54 <peter1138> No, forget it, I was confused again.
21:04:30 <nielsm> round-robin delivery of cargo to industries would absolutely help with things like FIRS supplies
21:04:47 <peter1138> nielsm, samu's patch will help, it just does it randomly.
21:04:57 <nielsm> yeah, round-robin would be better imo
21:04:59 <peter1138> Which statistically may work fine.
21:05:20 <peter1138> RR guarantees each industry will see a bit.
21:05:41 *** supermop_work_ has quit IRC
21:05:47 <nielsm> I suppose you could do a middle path
21:06:16 *** supermop_work has quit IRC
21:06:16 <nielsm> each delivery takes one random value, which is used for the first industry to get any cargo, and the following are done RR
21:07:09 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh9DI
21:07:33 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN approved pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh9DL
21:07:45 <peter1138> Oh!
21:07:49 <peter1138> That's quite a good idea.
21:08:33 <peter1138> As I understand it, the first industry will take as much as it can, or is it one at a time?
21:08:57 <DorpsGek_II> [OpenTTD/OpenTTD] LordAro approved pull request #7186: Fix #7108: Missed generate_widget script run for livery changes. https://git.io/fh9DY
21:08:59 <Samu> the num_pieces is a low value
21:09:04 <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh merged pull request #7185: Fix fdc2e85: Double close of file handles https://git.io/fh91Z
21:09:12 <Samu> 5, 10 or 20
21:09:45 <Samu> road vehicles unload 5 at a time
21:09:48 *** Progman has quit IRC
21:09:50 <Samu> trains too
21:09:55 <Samu> ships can unload 20
21:09:59 <peter1138> Per wagon, though, no?
21:10:12 <Samu> 5 per wagon, the function is called per wagon
21:10:15 <nielsm> each unload generates one cargo packet
21:10:17 <peter1138> Ahhh
21:10:37 *** Progman has joined #openttd
21:12:06 <peter1138> So it looks until every industry rejects it. Makes sense.
21:13:07 <peter1138> And you deliver 1 piece at a time. Hmm.
21:13:19 <peter1138> I wonder how this affects performance on a map with lots of deliveries.
21:13:54 <peter1138> You are calling the NewGRF calling 5, 10 or 20 times instead of once or twice.
21:14:00 <peter1138> callback*
21:14:17 <Samu> yes
21:14:26 <DorpsGek_II> [OpenTTD/OpenTTD] michicc commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9DW
21:14:37 <andythenorth> I am broken
21:14:45 <peter1138> In which case it may be better to distribute min_pieces every time, and do full round-robin to ensure distribution.
21:14:48 <andythenorth> I went climbing, everything hurts now
21:14:48 <andythenorth> also I had a kebab
21:15:19 <DorpsGek_II> [OpenTTD/OpenTTD] michicc merged pull request #7186: Fix #7108: Missed generate_widget script run for livery changes. https://git.io/fh9Mj
21:16:05 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN commented on pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9D4
21:16:36 <peter1138> I had dinner, and then went out on a bike. But the bike is too small, so I came back before I killed my knees.
21:16:40 <peter1138> My MTB is dead :(
21:18:33 <LordAro> D:
21:19:46 <peter1138> Who can create newgrf-specs wiki accounts?
21:20:03 <peter1138> LordAro, I'm gutted.
21:20:13 <LordAro> what happened to it?
21:20:15 <peter1138> LordAro, it was in my garden
21:20:18 <peter1138> and it fell over
21:20:21 <peter1138> and it cracked the frame
21:20:27 <orudge> peter1138: They're just tt-forums.net accounts
21:20:31 <LordAro> ...impressive
21:20:32 <peter1138> orudge!
21:20:37 <orudge> peter1138!
21:20:40 <peter1138> LordAro, think it must have bounced off a corner.
21:20:47 <peter1138> " Auto-creation of a local account failed: Automatic account creation is not allowed. "
21:20:54 <peter1138> orudge, I get that
21:21:20 <andythenorth> I got that for a while
21:21:22 <andythenorth> then I didn't
21:22:05 <peter1138> I even changed my tt-forums password in case is was something like it being ancient.
21:22:12 <peter1138> And lol, that password was bad.
21:22:14 <andythenorth> yeah I did all this
21:22:17 <peter1138> And then I discovered by dropbox isn't syncing.
21:22:21 <orudge> peter1138: interesting
21:22:28 <andythenorth> then one day it started working again
21:22:29 <peter1138> So I had to a password reset anyway.
21:22:30 <orudge> It could be that it has been broken for years and nobody's complained
21:22:33 <andythenorth> on my original account and password
21:22:38 <andythenorth> I complained a lot :)
21:22:55 <peter1138> Well, I need to update the wiki else someone will complain at me :D
21:22:57 <nielsm> I think I don't have a working login for newgrf-wiki either
21:23:02 <andythenorth> https://www.tt-forums.net/viewtopic.php?f=68&t=74378
21:23:11 <andythenorth> post your wiki updates in a thread on tt-f
21:23:20 <andythenorth> and the community will update the wiki for you
21:23:48 <nielsm> [citation needed]
21:23:59 <nielsm> [quote]this good enough?[/quote]
21:24:02 <peter1138> garryg seems an interesting fellow
21:24:17 <andythenorth> he is
21:24:24 <peter1138> Can't seem to decide if his industry newgrf should be 32 or 64 cargos :p
21:24:25 <orudge> peter1138: Were you at one point "petern" on the wiki?
21:24:30 <andythenorth> he has a brain injury of some kind, but he makes loads of nice grfs
21:24:33 <peter1138> orudge, erm, possible.
21:24:49 <peter1138> andythenorth, yeah, I figured. He's not unpleasant at all.
21:24:53 <orudge> There's a petern user there, I wonder if we changed your username on the forums and it hasn't changed here, or similar
21:25:31 <peter1138> " The supplied credentials could not be authenticated. "
21:25:34 <peter1138> Ah
21:25:37 <peter1138> Think you've got it.
21:25:42 <peter1138> Stupid me, changing my name.
21:25:51 <orudge> I'll get the wiki account renamed
21:26:23 <peter1138> Thanks <3
21:27:17 <Samu> testing for a desync while having dinner, afk
21:27:31 <peter1138> I don't think it'll desync.
21:28:10 <orudge> "The user "Petern" does not exist." while trying to rename, helpful
21:28:17 <peter1138> o_O
21:39:52 <planetmaker> hi
21:43:37 *** supermop_work has joined #openttd
21:47:41 *** glx has joined #openttd
21:47:41 *** ChanServ sets mode: +v glx
21:49:39 <orudge> peter1138: can you try to log in to the grfspecs wiki now?
21:50:57 *** supermop_work__ has quit IRC
21:51:53 <nielsm> orudge, I can't log in either :) username on forums jfs, might have been G4S once upon a time
21:52:45 <orudge> nielsm: what error do you get? Is it the "auto-creation" error?
21:53:11 <nielsm> yes
21:53:12 <nielsm> Auto-creation of a local account failed: Automatic account creation is not allowed.
21:53:27 <planetmaker> hm... I got previously an SSL_ERROR_NO_CYPHER_OVERLAP on tt-f. But that's gone now
21:56:17 <orudge> nielsm: can you try again now?
21:56:43 <nielsm> nope still not
21:57:30 <nielsm> and just logged out and back in on forums to confirm password :P
22:01:21 <orudge> nielsm: could you try one more time?
22:02:53 <nielsm> still not :(
22:04:39 *** octernion has joined #openttd
22:05:25 *** gelignite has quit IRC
22:09:41 *** octernio_ has quit IRC
22:15:34 *** Thedarkb-T60 has joined #openttd
22:20:54 <peter1138> orudge, works, thanks :-)
22:22:12 <peter1138> Hmm, the wiki wants ottd svn revision :p
22:23:58 <orudge> nielsm: can you try now, perhaps in a different browser/fresh browsing session?
22:24:03 <orudge> I was just able to log in with a brand new user
22:24:40 <nielsm> yep worked now
22:24:43 <nielsm> ty
22:24:52 <orudge> No problem, thanks for letting me know
22:25:17 <peter1138> Sorry to have mess you around.
22:25:24 <orudge> No, sorry it was broken!
22:27:16 <andythenorth> :)
22:28:14 <peter1138> " Initial planning for the Transport Tycoon Forums Meet 2017, which is taking place in Birmingham, UK "
22:28:17 <peter1138> Hmm
22:28:21 <peter1138> Did it?
22:28:24 <orudge> It did!
22:28:32 <orudge> And some people even turned up
22:28:33 <orudge> We had cake
22:28:46 <peter1138> And I wasn't around at that point.
22:29:03 <peter1138> Also I'm about twice the age of everyone else :p
22:29:14 <peter1138> Well, not any more, heh.
22:29:30 <orudge> Some of our younger users are probably half my age now, at any rate
22:30:37 * andythenorth wonders about cleaning up some forum stickies :)
22:30:55 <andythenorth> this one is quite dead :) https://www.tt-forums.net/viewtopic.php?f=33&t=21678
22:31:36 <andythenorth> this one should really just delegate to github :) https://www.tt-forums.net/viewtopic.php?f=33&t=7933
22:32:07 <peter1138> Is it stickied?
22:33:06 <andythenorth> yes
22:33:12 <andythenorth> this one could do with going to github too https://www.tt-forums.net/viewtopic.php?f=31&t=7253
22:33:13 <peter1138> OS X fonts?
22:33:37 <andythenorth> I have some
22:33:38 <peter1138> Strange, I don't see stickied posts then.
22:34:07 <andythenorth> :o
22:35:40 <peter1138> Ah, cos my settings don't show older posts by default.
22:35:51 <peter1138> And stickied posts apparently still count as threads. Nice.
22:40:45 *** frosch123 has quit IRC
22:40:51 *** synchris has quit IRC
22:47:56 *** supermop_work has quit IRC
22:56:14 <planetmaker> adjusted as of your reply @ andy
23:02:59 <andythenorth> thanks :)
23:03:48 <DorpsGek_II> [OpenTTD/OpenTTD] SamuXarick updated pull request #7184: Change: Distribute cargo to multiple stations or industries https://git.io/fh9lr
23:08:17 *** nielsm has quit IRC
23:09:06 *** sla_ro|master has quit IRC
23:12:54 <DorpsGek_II> [OpenTTD/OpenTTD] PeterN opened pull request #7187: Change: Add scrollbar to cargo legend in cargo payment rates window. https://git.io/fh99m
23:16:55 *** Progman has quit IRC
23:20:53 *** Flygon has joined #openttd
23:33:00 *** andythenorth has quit IRC
23:36:38 <glx> hey #7186 was squirrel_export, not generate_widgets
23:36:52 <peter1138> :/
23:37:36 <glx> but I guess you ran both anyway
23:37:47 <peter1138> Yes
23:37:52 <LordAro> lol
23:38:06 <LordAro> really need to add both of those to the commit hooks somehow
23:38:30 <peter1138> It proves I should continue my build changes to always build them.
23:38:49 <glx> yes better to integrate in the flow
23:39:02 <peter1138> I have most of it working, anyway.
23:39:14 <peter1138> At least for Makefile, I don't remember if I got anywhere with MSVC :-)
23:41:59 *** octernion has quit IRC
23:43:46 *** Wolf01 has quit IRC
23:46:47 *** keoz has quit IRC
23:50:10 *** Thedarkb1-T60 has joined #openttd
23:51:47 <Samu> peter1138: there's still problems with multiple AIs in multiplayer :(
23:52:07 <glx> hehe indeed you ran generate_widgets in #7108 :)
23:52:36 <Samu> https://imgur.com/Kv4lzLH
23:52:47 <Samu> i clicked reload AI in one of the AIs
23:52:53 <Samu> got that error on the left
23:52:57 <glx> but it would be better to just run both script in one command
23:53:19 <Samu> the other on the right which was connected to the server, timed out after 20 seconds, and i guess it crashes when heading to main meny
23:53:25 <peter1138> ^ I dunno, that might be fixed by the last commit?
23:54:04 <peter1138> Or it's just somethign that's always happened.
23:54:12 <peter1138> And I should just ignore you.
23:55:09 *** Thedarkb-T60 has quit IRC
23:57:14 <Samu> oosp
23:57:28 <Samu> https://imgur.com/yFlk0Xn the error on the client wasn't in that last image
23:57:44 <peter1138> Why are you telling me?
23:58:28 <glx> but you should do the testing in clean master
23:59:49 <Samu> the one with 1 day per company?
23:59:56 <Samu> 1 company per day