IRC logs for #openttd on OFTC at 2023-05-13
            
00:07:35 *** ChanServ sets mode: +v blathijs
01:26:27 *** Wormnest has quit IRC (Quit: Leaving)
02:33:33 *** nebulabc has quit IRC (Quit: Must have rage quit ยฏ\_(ใƒ„)_/ยฏ)
02:33:53 *** nebulabc has joined #openttd
02:56:31 *** debdog has joined #openttd
03:00:01 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
03:17:46 *** HerzogDeXtEr has joined #openttd
03:46:00 *** keikoz has joined #openttd
04:12:58 *** keikoz has quit IRC ()
04:26:09 *** keikoz has joined #openttd
05:25:35 *** leohoo_sdu[m] has joined #openttd
05:25:38 *** leohoo_sdu[m] has left #openttd
07:02:02 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 opened pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814
07:07:41 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814#pullrequestreview-1425351852
07:08:46 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814
07:48:59 *** nielsm has joined #openttd
08:34:33 *** SpComb has joined #openttd
09:23:42 *** SpComb^ has joined #openttd
09:23:43 *** SpComb^ has quit IRC ()
10:29:20 <DorpsGek> [OpenTTD/OpenTTD] michicc commented on pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814#pullrequestreview-1425372794
11:00:47 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814
11:20:34 <DorpsGek> [OpenTTD/survey-web] TrueBrain merged pull request #4: Add: Cloudflare Worker code to handle survey results and new survey key requests https://github.com/OpenTTD/survey-web/pull/4
11:21:39 <DorpsGek> [OpenTTD/survey-web] TrueBrain opened pull request #5: Fix: broken badges in README https://github.com/OpenTTD/survey-web/pull/5
11:21:47 <DorpsGek> [OpenTTD/survey-web] TrueBrain merged pull request #5: Fix: broken badges in README https://github.com/OpenTTD/survey-web/pull/5
11:25:24 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain updated pull request #10719: Feature: opt-in survey when exiting a game https://github.com/OpenTTD/OpenTTD/pull/10719
11:48:56 *** Elouin has quit IRC (Quit: So long and thanks for all the fish!)
11:57:52 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700#pullrequestreview-1425381503
12:00:48 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700#pullrequestreview-1425383425
12:13:33 <TrueBrain> okay, weirdest one with that PR is that timetable remains on calendar
12:13:44 <TrueBrain> so if you would to freeze the calendar ... timetables stop working? ๐Ÿ™‚
12:14:21 <DorpsGek> [OpenTTD/OpenTTD] github-code-scanning[bot] commented on pull request #10719: Feature: opt-in survey when exiting a game https://github.com/OpenTTD/OpenTTD/pull/10719#pullrequestreview-1425386077
12:18:14 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700#issuecomment-1546637186
12:18:37 <TrueBrain> all in all, we need a bit more work to split out some odd timers first ... newgrf profiling is one of them .. based on calendar dates .. weird
12:19:25 <TrueBrain> CodeQL in 10719 lies ... that variable is used. Why does it think it isn't? Hmm
12:19:52 <TrueBrain> ah, no JSON support installed for the CodeQL run .. oops
12:20:48 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain updated pull request #10719: Feature: opt-in survey when exiting a game https://github.com/OpenTTD/OpenTTD/pull/10719
12:41:54 <TrueBrain> lol, you can't stop a newgrf profile of a grf that didn't generate any events yet
12:42:00 <TrueBrain> that is a bit unclear at first use ๐Ÿ™‚
12:42:43 <TrueBrain> well, it is a bug
12:42:56 <TrueBrain> if you start a profile for N time, and it didn't generate an event, it will continue to run on the background
12:42:57 <TrueBrain> for ever
12:42:58 <TrueBrain> ๐Ÿ˜„
12:49:05 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain opened pull request #10815: Codechange: rework NewGRFProfiler to use ticks instead of calendar-days https://github.com/OpenTTD/OpenTTD/pull/10815
12:49:41 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10815: Codechange: rework NewGRFProfiler to use ticks instead of calendar-days https://github.com/OpenTTD/OpenTTD/pull/10815#pullrequestreview-1425393636
12:53:18 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain opened pull request #10816: Fix: NewGRF Profile didn't stop if there were no events yet https://github.com/OpenTTD/OpenTTD/pull/10816
12:59:06 <pickpacket> I think Iโ€™m gonna start experimenting with pre-signals in my next game
13:02:58 <DorpsGek> [OpenTTD/OpenTTD] michicc approved pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814#pullrequestreview-1425395310
13:08:18 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
14:10:28 <TrueBrain> boooo, the new ClampTo template can't be used by strongtypedef, as it is but isn't an integer ๐Ÿ˜›
14:18:18 <TrueBrain> guess I need to specify it per resulting type .. which is fine-ish ๐Ÿ™‚
14:18:31 <TrueBrain> I am sure a template-way exists to fix that ๐Ÿ˜„
14:23:57 <TrueBrain> `error: call to function 'ClampTo' that is neither visible in the template definition nor found by argument-dependent lookup`
14:24:02 <TrueBrain> never seen that error before ๐Ÿ˜„
14:27:56 <DorpsGek> [OpenTTD/OpenTTD] mrmbernardi commented on pull request #10807: Change: [YAPF] Penalty for crossing a reserved segment is now constant https://github.com/OpenTTD/OpenTTD/pull/10807#issuecomment-1546665156
14:39:13 <DorpsGek> [OpenTTD/OpenTTD] jimyouare commented on issue #10083: [Bug]: Cheats menu doesn't work by default on macOS https://github.com/OpenTTD/OpenTTD/issues/10083
14:40:41 <michi_cc[d]> TrueBrain: Making a template is possible, except that you need have the reversed condition on the original `ClampTo`, which is unfortunate due to the header dependency:
14:40:41 <michi_cc[d]> ```c++
14:40:41 <michi_cc[d]> template <typename To, typename T>
14:40:41 <michi_cc[d]> constexpr std::enable_if_t<std::is_base_of_v<StrongIntegralTypedef<typename T::Type, T>, T>, To> ClampTo(T value) {
14:40:41 <michi_cc[d]> return ClampTo<To>(value.value);
14:40:43 <michi_cc[d]> }
14:40:58 <TrueBrain> yeah ... I got to that point .. then was like: nah, I'm good ๐Ÿ˜„
14:41:41 <TrueBrain> `IsInsideMM` is a nasty function, template-wise
14:41:48 <TrueBrain> the casting to `size_t` is .. annoying
14:42:09 <TrueBrain> `use of overloaded operator '-' is ambiguous`
14:42:14 <TrueBrain> I am fighting overloads, which is fun ๐Ÿ˜›
14:46:24 <TrueBrain> but I can now do `using Date = NewStrongTypedef<int32, struct DateTag>;`
14:46:32 <TrueBrain> which at least is better than copy/pasting the whole template for every type ๐Ÿ˜›
14:59:23 <TrueBrain> lol, the auto-conversion to int32 for these kind of types kinda makes it a bit pointless .. ๐Ÿ˜„ Compilers are too smart ..
15:46:00 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain updated pull request #10761: Codechange: make TimerGameCalendar types strongly typed https://github.com/OpenTTD/OpenTTD/pull/10761
15:46:12 <TrueBrain> wauw, that was a lot more messy than I expected ... being explicit when we want the integer value and when we want the type requires a lot of places that needs .. attention ๐Ÿ˜„
15:48:43 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700#pullrequestreview-1425411409
15:49:12 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler updated pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700
15:49:15 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10761: Codechange: make TimerGameCalendar types strongly typed https://github.com/OpenTTD/OpenTTD/pull/10761#issuecomment-1546696187
15:49:28 <TrueBrain> michi_cc[d]: if you have some time, curious what you think of this `NewStrongTypedef` approach ๐Ÿ™‚
15:49:36 <TallTyler> Huh, why do my replies to your comments not show your comments? Silly GitHub... ๐Ÿ˜›
15:49:58 <TallTyler> Oh, they do, just not below my review reply...
15:50:18 <TrueBrain> curious if this works with TileIndex .. or how much that depends on implicit conversion ๐Ÿ˜„
15:51:41 <TrueBrain> answer: a lot!
15:51:43 <TrueBrain> ๐Ÿ˜„
15:53:17 <TrueBrain> michi_cc[d]: seems TileIndex isn't as strong as the name suggests ๐Ÿ˜„ Anything that can go to/from uint32 silently works ๐Ÿ™‚ Not sure that is a bad thing; but funny nevertheless ๐Ÿ™‚
15:54:53 <TrueBrain> TallTyler: no clue what you did, but yeah, comments are weird ๐Ÿ˜›
15:54:58 <michi_cc[d]> TrueBrain: Yes, because the `TileIndex` class explicit adds it.
15:55:20 <michi_cc[d]> Otherwise the change PR would have been like 500000 modified lines.
15:55:25 <TrueBrain> hihi, like my PR is now? ๐Ÿ˜›
15:55:30 <TrueBrain> well, not for TileIndex
15:55:32 <TrueBrain> but for Date / Year ๐Ÿ˜„
15:55:57 <TrueBrain> but more my point, because it is not explicit, it isn't really strong; compilers disapoint me ๐Ÿ˜›
15:56:22 <TrueBrain> `TimerGameCalendar::Date d = TileIndex(0)` works, basically ๐Ÿ™‚
15:56:54 <TrueBrain> (again, not sure that is a bad thing)
15:57:05 <michi_cc[d]> Well, the `StrongIntegralTypedef` base does have the implicit conversion, but the point of the strong typedef for TileIndex isn't to prevent assignability, but to make sure templates resolve differently.
15:57:21 <michi_cc[d]> *not
15:57:22 <TrueBrain> yeah, okay, so it doesn't use the strong part ๐Ÿ™‚
15:57:35 <TrueBrain> as long as it was intentional ๐Ÿ™‚
15:57:55 <TrueBrain> I really did want the strong part for Date / Year, as we will have Calendar and Economy .. and boy, it shows a lot of weirdness ๐Ÿ˜›
15:58:02 <michi_cc[d]> It is strong in the sense that it is a new type, which a normal typedef is not.
15:58:21 <michi_cc[d]> So the whole point is about the c++ type system, not casting/conversions.
15:58:31 <TrueBrain> TallTyler: please check time-table again; your PR still had a lot of Calendar references to it, not economy ๐Ÿ™‚
15:59:09 <TrueBrain> michi_cc[d]: yes, I got you the first time ๐Ÿ™‚ It was just unexpected, but as I said a few times already: I am not saying this is a bad thing ๐Ÿ™‚
16:00:43 <michi_cc[d]> If you want unassignable types, just start/modify the base to remove any implicit or explicit cast or assignment operators. It can probably still look nice by using custom literals for numbers.
16:01:09 <TrueBrain> yeah, see my PR
16:01:54 <TrueBrain> and from int to date, I am fine with that conversion; so I left that in
16:02:00 <TrueBrain> but from date to int is now only allowed explicit
16:02:58 <TrueBrain> still no clue if we want to go this way; but I am still scared we will mix up `Year` from `Calendar` to `Economy`; this would protect against that
16:03:40 <TrueBrain> custom literals are an interesting idea ... `1Y` ๐Ÿ˜„
16:04:20 <michi_cc[d]> One could bike-shed though if the using approach is really needed or a `struct Bla : StrongTypedef<int, Bla> {}` isn't also good enough.
16:04:44 <TrueBrain> the errors I got back were much more understandable with a `using` ๐Ÿ™‚
16:04:55 <TrueBrain> so the bike-shed goes both ways ๐Ÿ˜„
16:07:15 <TrueBrain> there is btw no fundamental difference, I think. In one case the struct is defined outside, in the other case it is defined as tag inside the template
16:09:11 <michi_cc[d]> The only difference really is `TileIndex` as that needs some custom code for dealing with the use of both int32 and uint32 in the code. And for that at least using the derived type as the operator results is better.
16:09:30 <TrueBrain> I have seen some nice ways to do that; going to experiment with that next ๐Ÿ˜›
16:09:36 <TrueBrain> just as a fun "wtf can you do with templates" ๐Ÿ˜„
16:09:49 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler updated pull request #10700: Codechange: Split dates and timers into Economy and Calendar time https://github.com/OpenTTD/OpenTTD/pull/10700
16:09:58 <TallTyler> Should be fixed, unless I'm looking in the wrong place ๐Ÿ™‚
16:10:16 <michi_cc[d]> So, C++20 for concepts then? ๐Ÿคฃ
16:10:26 <TrueBrain> btw, question you might now: in `StrongTypedef` there are 2 `operator =` on `StrongTypeDef` .. they scared me a tiny bit, as how I read it, you can assign any `StrongTypedef` to any other, not? (again, fine for the `TileIndex` usecase, but they might negate mine ๐Ÿ˜› )
16:10:38 <TrueBrain> michi_cc[d]: yeah ... if only we could!
16:10:51 <TrueBrain> well, maybe we can even .. ๐Ÿ˜›
16:11:44 <michi_cc[d]> No, as `StrongTypedef` is a templated type, so it only refers to the same (templated) type.
16:11:55 <TrueBrain> ah, yes, ofc
16:12:07 <TrueBrain> with inheritance, that becomes a bit annoying to read ๐Ÿ˜›
16:12:10 <TrueBrain> but that makes sense ๐Ÿ˜„ Tnx ๐Ÿ™‚
16:12:51 <TrueBrain> I am btw shocked with the amount of magic in STL .. `std::min` needs `<`, but if you have an implicit cast to `int32` that is also fine ๐Ÿ˜›
16:13:07 <TrueBrain> sometimes things compiled .. where I did not expect it to compile ๐Ÿ˜„
16:15:47 <glx[d]> std::min can guess if possible
16:15:58 <gnomechomsky> Do little internal helper methods require a declaration in the header? I don't think the code style document covers this
16:16:39 <glx[d]> in header if you want it available everywhere
16:17:01 <glx[d]> we have a lot of static functions local to the cpp files only
16:19:34 <gnomechomsky> Ah I'll do the second one
16:19:51 <gnomechomsky> It's just extracting a big switch common to two methods
16:20:53 <TrueBrain> `โ€˜constexprโ€™ call flows off the end of the function` lol @ error
16:21:04 <TrueBrain> today I found the weirdest errors ๐Ÿ˜„ For my collection!
16:23:14 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #10816: Fix: NewGRF Profile didn't stop if there were no events yet https://github.com/OpenTTD/OpenTTD/pull/10816#pullrequestreview-1425437772
16:23:27 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain merged pull request #10816: Fix: NewGRF Profile didn't stop if there were no events yet https://github.com/OpenTTD/OpenTTD/pull/10816
16:26:06 <TrueBrain> michi_cc[d]: can we use C++23? I kinda want explicit this ๐Ÿ˜› Makes it even easier to make it look pretty!
16:28:04 <glx[d]> <https://en.cppreference.com/w/cpp/compiler_support/23> depending on which feature is used
16:28:13 <TrueBrain> explicit this!
16:28:25 <TrueBrain> has no support yet what so ever!
16:28:54 <glx[d]> partial in MSVC
16:29:11 *** Wormnest has joined #openttd
16:29:51 <TrueBrain> ugh, okay, enough toying with templates .. first dinner ๐Ÿ˜„
16:37:25 <glx[d]> looks like gcc13 has some issues with your templates
16:40:30 <TrueBrain> Shocker
16:41:30 <TrueBrain> Nah, it is not gcc13
16:41:55 <TrueBrain> Just me being silly
17:20:27 <TrueBrain> michi_cc[d]: I was thinking something like `using Date = NewStrongTypedef<int32, struct DateTag, Comparable, Integer>;`
17:20:37 <TrueBrain> where you can give some mixins to define how the new type should behave
17:20:48 <TrueBrain> one of them could be `Convertable<uint>` or something, for TileIndex
17:20:57 <TrueBrain> is that silly?
17:25:42 <petern> Evening
17:25:49 <TrueBrain> how many km?
17:26:12 <petern> 228.74
17:27:34 <TrueBrain> more than I do all year ๐Ÿ˜›
17:27:39 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1106996190639312896/image.png
17:27:39 <andythenorth> I want to move "More..." sub-group to the end of the list ๐Ÿ˜›
17:27:46 <andythenorth> I guess I write more python ๐Ÿ™‚
17:27:53 <petern> Literally move it in the source ๐Ÿ˜„
17:28:18 <petern> Wasn't there a sort order thing, that maybe works if you have < 255 engines...
17:28:43 <andythenorth> sort order works fine
17:28:54 <andythenorth> I have a thing that automates it
17:29:01 <andythenorth> but it's not variant aware
17:29:37 <petern> Hmm, variants should appear in that order within the group.
17:31:14 <andythenorth> they do
17:31:31 <andythenorth> all is well in grf spec
17:31:51 <andythenorth> but I am kind of gaffer-taping variants into Horse
17:32:38 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #10813: Codechange: Rework station distant-join list. https://github.com/OpenTTD/OpenTTD/pull/10813
17:33:58 <petern> Oh feck off VS Code
17:36:13 <TrueBrain> `error: must use a qualified name when declaring a conversion operator as a friend`
17:36:14 <TrueBrain> ` error: friend function definition cannot be qualified with 'TType::'`
17:36:16 <TrueBrain> sometimes ... ๐Ÿ˜›
17:36:22 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #10813: Codechange: Rework station distant-join list. https://github.com/OpenTTD/OpenTTD/pull/10813
17:43:01 <TrueBrain> bah, all operators behave excellent, but cast-operators are like: NO! We work differently! NANANANANA
17:50:07 <michi_cc[d]> TrueBrain: Why not if it works.
17:50:28 <TrueBrain> I don't always know what is good to use from C++ ๐Ÿ˜›
17:50:34 <TrueBrain> too many options .. not all are good ๐Ÿ˜„
17:52:53 <TrueBrain> grr, GitHub closed down their most efficient way of searching for code in their codebase .. now all we got left is this weird thing they consider "code search"
17:52:57 <TrueBrain> it is horrible
17:55:29 <andythenorth> https://cdn.discordapp.com/attachments/1008473233844097104/1107003198587289721/image.png
17:55:34 <andythenorth> this was 4 lines of python ๐Ÿ™‚
17:55:45 <andythenorth> I assumed I'd be here all evening failing
17:58:44 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #10813: Codechange: Rework station distant-join list. https://github.com/OpenTTD/OpenTTD/pull/10813#pullrequestreview-1425446669
18:00:36 <TrueBrain> `does not specialize an instantiated member` .. grr, I hate these errors .. so impossible to figure out what it actually means ๐Ÿ˜„
18:04:13 *** cebopp1[m] has left #openttd
18:09:44 *** gelignite has joined #openttd
18:18:05 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #10813: Codechange: Rework station distant-join list. https://github.com/OpenTTD/OpenTTD/pull/10813
18:31:07 <TrueBrain> hmm, the implicit conversion is annoying ๐Ÿ˜„ Such mean things, compilers ...
18:31:26 <TrueBrain> still can't believe all operators behave like A, but one is like: nnnooooo, I am going to be like B!
18:32:40 <petern> Sometimes we want it, sometimes we don't...
18:32:47 <petern> Compilers should KNOW!
18:41:14 <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/e1b653137f3cbd6942d627f7bdaba994370d8b67
18:41:15 <DorpsGek> - Update: Translations from eints (by translators)
18:59:58 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #10815: Codechange: rework NewGRFProfiler to use ticks instead of calendar-days https://github.com/OpenTTD/OpenTTD/pull/10815#issuecomment-1546731227
19:00:28 <TrueBrain> so my PR fixes that \o/ ๐Ÿ˜„
19:02:15 <TrueBrain> michi_cc[d]: ironically, `concepts` does allow for solving explicit / implicit nicely ๐Ÿ˜‰
19:02:26 <TrueBrain> just .. so many warnings and errors when switching to C++20! ๐Ÿ˜ฎ
19:02:41 <TrueBrain> (I had to try .. my SFINAE sucks :P)
19:02:52 <petern> Your what? (Bless you)
19:02:57 <TrueBrain> ` explicit constexpr operator TValueType () const requires (TExplicit == 1) { return this->value; }`
19:02:57 <TrueBrain> ` constexpr operator TValueType () const requires (TExplicit == 0) { return this->value; }`
19:03:00 <TrueBrain> that at least works nicely ๐Ÿ™‚
19:03:21 <TrueBrain> when I try that with C++17, with `enable_if`, it keeps trying to enable both ..
19:03:44 <TrueBrain> suggestions or ideas are very welcome ๐Ÿ™‚
19:04:44 <TrueBrain> C++20 really doesn't like our `SaveLoad` for some reason
19:08:43 <andythenorth> in the context of name callback, do I still OR strings with 0xD000?
19:08:50 <andythenorth> or some other value?
19:09:15 <andythenorth> 0xD000 is the value used in additional_text cb
19:10:13 <michi_cc[d]> Depends on how you use it. All text CB results itself are 0..3FF and OTTD implicitly adds the D800 to them. For use on the text stack you (or NML) has to give the full string ID.
19:16:30 <andythenorth> trying to use the return value of a procedure
19:17:18 <michi_cc[d]> The actual CB result has to be 0..3FF.
19:17:32 <michi_cc[d]> So not adding any Dxxx to it.
19:18:21 <TrueBrain> https://godbolt.org/z/5KTTG9KPj <- anyone any idea what I am doing wrong there? Or is this just not possible? ๐Ÿ™‚
19:18:33 <TrueBrain> (well, it works with `concepts`, but .. yeah :P)
19:19:27 <DorpsGek> [OpenTTD/OpenTTD] mrmbernardi opened pull request #10817: Feature: [GS] Goal destination can be updated https://github.com/OpenTTD/OpenTTD/pull/10817
19:21:54 <petern> Hmm, adding features to work around gamescripts being unable to do bulk changes because we applied AI limits to them... Not sure.
19:23:10 <gnomechomsky> petern: what's the background here?
19:24:15 <petern> It would be nice if GS could just send more than one command before being suspended somehow
19:24:24 <TrueBrain> I made a draft for that! ๐Ÿ˜›
19:24:55 <petern> Oh!
19:25:26 <TrueBrain> https://gist.github.com/TrueBrain/ebeb53986081b506a46e51d1484bfc3a
19:25:43 <petern> That's a gist not a draft ๐Ÿ˜‰
19:25:50 <TrueBrain> a draft for an idea ๐Ÿ˜›
19:26:19 *** dP has joined #openttd
19:26:19 <dP> fyi, I did equivalent of my insta-gs branch on citymania and it works just fine executing commands instantly
19:26:25 <gnomechomsky> Still the current method involves deleting and recreating the goal which I think would reorder it in the list
19:26:43 <dP> except citymania has callbacks so there is recursion issues but gs is event-based doesn't have them
19:26:47 <petern> I think conceptually deleting and recreating is correct, though.
19:27:00 <petern> (Especially if it's the company that changes)
19:27:13 <andythenorth> oof
19:27:22 <andythenorth> what other values can I add to strings to make them work?
19:27:28 <andythenorth> 0xD000 isn't doing it in this case
19:27:47 <gnomechomsky> Hmm, it's the destination as in where the user is taken when they click on the goal. I haven't supported changing the company the goal applies to
19:27:57 <andythenorth> I've tried ORing before the procedure call, in the procedure call, and after the procedure call
19:28:06 <andythenorth> I have to use the text stack because I'm out of string IDs
19:28:12 <petern> I know you didn't, you wrote that ๐Ÿ™‚
19:28:48 <dP> goal ordering is a pita though
19:29:00 <dP> they're just not meant to be ordered
19:29:17 <dP> took me like 3 rewrites or smth to get it right xD
19:30:12 <michi_cc[d]> TrueBrain: This apparently works?? -> <https://godbolt.org/z/x377E5c5o>
19:30:20 <petern> Hmm, that's probably easily solvable... include sort order in the API?
19:30:41 <petern> (Sort position)
19:30:49 <michi_cc[d]> No idea why though ๐Ÿ™‚
19:30:50 <TrueBrain> michi_cc[d]: do I dare to ask WHY that works? ๐Ÿ˜›
19:30:52 <TrueBrain> haha
19:30:52 <dP> yeah, I did that with league tables
19:31:26 <dP> so now that I no longer need to abuse goals for league tables I'm not sure they need to be ordered xD
19:31:32 <gnomechomsky> petern: Why was the limit applied? It's because the GS runs as if it were an AI script?
19:32:28 <michi_cc[d]> It's not a "limit" in the normal sense. Commands are async in network games, but the script interface has no concept of an async function.
19:32:49 <dP> it a limit in a sense that they don't need to be async
19:33:40 <michi_cc[d]> andythenorth: Could be DC00. Depends in which range NML allocated the string.
19:34:24 <andythenorth> thanks I'll try
19:34:30 <andythenorth> this string stuff ๐Ÿ˜ฆ
19:34:53 <petern> Is it cheese o'clock?
19:34:57 <andythenorth> yes
19:35:02 <andythenorth> 0xDC00 doesn't work
19:35:06 <TrueBrain> michi_cc[d]: it compiles; but it doesn't work in the way it does without the typename statement ๐Ÿ˜ฆ But .. this does give good snippets to work from ๐Ÿ™‚
19:35:07 <andythenorth> callback is failing in all cases
19:35:08 <michi_cc[d]> NML is not very meta at all, otherwise it would provide usable functions for handling strings and text stack stuff.
19:36:11 <michi_cc[d]> The callback result must be a string in the D800 range and returned as the offset from D800 (which should be what the `string()` built-in does).
19:36:20 <andythenorth> I think this is probably just not usable with procedures
19:37:06 <michi_cc[d]> Can you post the NFO of the procedure that NML generates so we can see what is actually returned?
19:39:50 <andythenorth> https://gist.githubusercontent.com/andythenorth/e50edb6717a1d8d0551449e4d1236d76/raw/919e11d7cbd6bd5ae1e082ed0bf1f9c319e6415e/gistfile1.txt
19:39:59 <andythenorth> I haven't read the nfo to check it's not user error
19:40:06 <andythenorth> but it's just a pass through currently
19:40:11 <andythenorth> it's passed a string, and it returns a string
19:40:22 <andythenorth> in actual intended use, it will put up to 8 values on the text stack
19:40:37 <petern> <https://www.youtube.com/watch?v=8NEH5yrcz3Q> Railtype Grass
19:40:52 <andythenorth> oh
19:40:55 <michi_cc[d]> Well, as long as the string is also allocated by NML in the D8xx range, the procedure result should be a valid CB result.
19:41:05 <andythenorth> YouTube has been showing me a lot of those java sugarcane railroads
19:41:19 <petern> I'll blame you then ๐Ÿ˜„
19:41:22 <andythenorth> michi_cc[d]: thanks, I think I just do without the procedure
19:41:54 <andythenorth> it will be a slower compile and bigger grf, but probably I spend so long figuring out how to make it work ๐Ÿ˜›
19:44:23 <TrueBrain> `using TileIndex = StrongTypedef<uint32, struct TileIndexTag, false, STCompare, STMath, STCompatible<int32>, STCompatible<int64>>;` <- works! Tnx michi_cc[d] ๐Ÿ™‚
19:44:32 <TrueBrain> we will see if MSVC also likes it, but that is another battle ๐Ÿ˜›
19:46:05 <andythenorth> ugh Horse
19:46:25 <andythenorth> so many vehicles, so extending the varact 2 chain for any callback is horrible bloat
19:46:37 <andythenorth> I've added 300 KB just to handle one buy menu name case
19:47:06 *** argoneus has quit IRC (Read error: Connection reset by peer)
19:48:18 <TrueBrain> right, now to find where some magic happens to allow converting a TileIndex to a stream-like something ๐Ÿ˜„
19:49:57 <michi_cc[d]> TrueBrain: `endian_buffer.hpp:55`
19:50:15 <TrueBrain> ah, yes, I read that part ..
19:50:19 <michi_cc[d]> And line 50 with the lovely templates, too ๐Ÿ™‚
19:50:22 <TrueBrain> didn't know it worked for `fmt` too ๐Ÿ˜„
19:50:51 <michi_cc[d]> Oh, the other stream-like seomthing ๐Ÿ™‚
19:50:59 <TrueBrain> ah, they are different ๐Ÿ˜›
19:51:05 <TrueBrain> as this code should just work still
19:52:08 <TrueBrain> btw, those two lines in `endian_buffer` are the reason `value` is public ๐Ÿ˜›
19:53:02 <glx[d]> I think sometimes nml adds the string range, sometimes it doesn't
19:55:25 <TrueBrain> okay, the cast operator remains weird ... if I remove the template stuff, everything compiles ... it I add it, most things work, except for `fmt` ๐Ÿ˜›
19:55:33 <TrueBrain> paint me yellow and call me a banana ๐Ÿ˜›
19:58:07 <DorpsGek> [OpenTTD/OpenTTD] mrmbernardi commented on issue #10383: [Bug]: GSTile.DemolishTile() doesn't demolish some entities https://github.com/OpenTTD/OpenTTD/issues/10383
19:59:55 <TrueBrain> concepts really are more readable ๐Ÿ™‚
20:02:17 <michi_cc[d]> For endian_buffer, making it `this->Write((typename T::Type)data);` doesn't require a public value BTW, except that for TileIndex specifically, it is also accessed in map_func.
20:02:43 <TrueBrain> owh, smart .. ๐Ÿ˜„
20:02:52 <TrueBrain> hmm .. how do I combine two checks with SFINAE ..
20:03:07 <michi_cc[d]> std::conjunction_v
20:03:27 <TrueBrain> `std::conjunction_v<std::is_same<T, TValueType>, TCond>` fails .. let's see ...
20:04:52 <michi_cc[d]> conjunction wants a TCond::value in this case.
20:05:21 <TrueBrain> `error: 'TCond' is not a class, namespace, or enumeration`
20:05:41 <TrueBrain> I understand people become expert in SFINAE after they became a rocket scientist ๐Ÿ˜„
20:06:35 <michi_cc[d]> I think `std::is_same<T, TValueType> && TCond` is supposed to work, but I didn't have good experiences with this either.
20:07:10 <TrueBrain> you get silly errors like `error: type-id cannot have a name`
20:07:22 <TrueBrain> totally non-descriptive what it was trying to do :p
20:07:56 <michi_cc[d]> Or `std::conjunction<std::is_same<T, TValueType>, std::integral_constant<bool, TCond>>` (totally untested).
20:09:03 <TrueBrain> https://godbolt.org/z/n85KWh467 <- compiler says no ๐Ÿ˜ฆ
20:09:30 <michi_cc[d]> sorry, confunction_v of course
20:09:46 <TrueBrain> that does a bit more ๐Ÿ˜„ But now `base_tiles[tile]` is confused again
20:09:51 <TrueBrain> argh, why did they make this so difficult?
20:09:56 <TrueBrain> can I just upgrade to C++20 and be done with this?
20:10:52 <andythenorth> can I update to grf v9 and be done with string crap? ๐Ÿ™‚
20:20:29 <TrueBrain> this is just so weird .. that template influences how the cast-operator works .. but not in a way that is really understandable ๐Ÿ˜›
20:23:30 <michi_cc[d]> Would it be possible to inject one of the two casts with a mixin class like the other traits you teased at?
20:23:44 <TrueBrain> couldn't get it to work
20:23:46 <TrueBrain> all operators work fine
20:23:49 <TrueBrain> but a cast-operator fails
20:26:57 <TrueBrain> lol, godbolt doesn't always do what I expect ๐Ÿ˜„ Closing random windows ...
20:30:56 <TrueBrain> https://godbolt.org/z/Psfb6583s <- that is what I am not up against ๐Ÿ™‚ Disable line 104, and it works fine ๐Ÿ™‚
20:33:14 <TrueBrain> okay, GCC shows most clear what is actually happening .. cast-operators are just very special ๐Ÿ˜›
20:33:31 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 merged pull request #10814: Codechange: replace C-style (stredup) chat completion with std::string_view https://github.com/OpenTTD/OpenTTD/pull/10814
20:38:52 <TrueBrain> right, so far fixing the C++20 warnings seems an easier approach to this problem ๐Ÿ˜›
20:47:27 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #10818: Fix: Don't use a loop to test if classid is valid. https://github.com/OpenTTD/OpenTTD/pull/10818
20:49:36 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #10818: Fix: Don't use a loop to test if NewGRF class is valid. https://github.com/OpenTTD/OpenTTD/pull/10818#pullrequestreview-1425459466
20:49:52 <glx[d]> we have silly loops
20:51:36 <petern> Yeah, I was converting to range-for and... er yeah.
20:54:17 <TrueBrain> I figured out how to do it with a mixin! That does not work how I expected it to .. but fine ๐Ÿ˜›
20:56:50 <DorpsGek> [OpenTTD/OpenTTD] ottdfevr opened issue #10819: [Bug]: Cannot clone a train https://github.com/OpenTTD/OpenTTD/issues/10819
20:57:59 <petern> ^ works for me.
20:58:19 <DorpsGek> [OpenTTD/OpenTTD] anatolyeltsov updated pull request #10541: Feature: Industry production graph https://github.com/OpenTTD/OpenTTD/pull/10541
20:58:42 <TrueBrain> but, another nightly bug report! ๐Ÿ˜›
20:59:08 <TrueBrain> yup, broken for me too
20:59:18 <TrueBrain> off-by-one
20:59:25 <TrueBrain> selection too
20:59:50 <petern> huh
21:00:03 <petern> Oh
21:00:08 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on issue #10819: [Bug]: Cannot clone a train https://github.com/OpenTTD/OpenTTD/issues/10819
21:00:16 <petern> I cloned a train from the viewport, not from the depot list. mistake
21:00:50 <TrueBrain> seems your scroll changes made it off-by-one ๐Ÿ˜„
21:01:00 <petern> Yeah. Hmm.
21:01:21 <petern> Same with any click
21:01:33 <glx[d]> yup it clones the line above the clicked one
21:01:34 <petern> Only that window though :p
21:01:43 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain updated pull request #10761: Codechange: make TimerGameCalendar types strongly typed https://github.com/OpenTTD/OpenTTD/pull/10761
21:02:04 <TrueBrain> let's see how other compilers think about my work ๐Ÿ˜„ And yes, the game is broken, the year starts at year 0 .. haven't looked into what ๐Ÿ˜› But that is not the point of that PR ๐Ÿ˜„
21:02:08 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on issue #10819: [Bug]: Cannot clone a train https://github.com/OpenTTD/OpenTTD/issues/10819
21:03:04 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on pull request #10761: Codechange: make TimerGameCalendar types strongly typed https://github.com/OpenTTD/OpenTTD/pull/10761#issuecomment-1546749261
21:03:35 * petern breaks out lldb
21:05:53 <petern> this->GetVehicleFromDepotWndPt(pt.x - nwi->pos_x, pt.y - nwi->pos_y, &v, &gdvp);
21:06:19 <petern> Ah, it's already removed the widget position.
21:06:46 <TrueBrain> owh, lol, ofc 10761 breaks regression .. I removed 4 settings, and I didn't want to deal with fixing the error they produced ๐Ÿ˜„ Lol
21:10:35 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #10817: Feature: [GS] Goal destination can be updated https://github.com/OpenTTD/OpenTTD/pull/10817#pullrequestreview-1425460441
21:15:51 <TrueBrain> `TileIndex size = Map::Size();` .. that is a weird type for size ..
21:16:28 <TrueBrain> owh, it is meant to be "last-tile" of sorts
21:16:32 <TrueBrain> lol, that took a bit too long ๐Ÿ˜„
21:16:57 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #10815: Codechange: rework NewGRFProfiler to use ticks instead of calendar-days https://github.com/OpenTTD/OpenTTD/pull/10815#pullrequestreview-1425461048
21:17:15 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain merged pull request #10815: Codechange: rework NewGRFProfiler to use ticks instead of calendar-days https://github.com/OpenTTD/OpenTTD/pull/10815
21:19:07 <TrueBrain> hmm, funny, with my PR, only on Windows, TileIndex is no longer 4 bytes ๐Ÿ˜„ Interesting ....
21:20:14 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:21:52 <petern> Ah ha, that's why I keep messing up trailing spaces -- it's a plugin and I've not enabled it for WSL-VS Code.
21:22:11 <TrueBrain> plugin? It is a setting, to remove trailing whitespaces on save?
21:22:14 <TrueBrain> or you mean something else ๐Ÿ™‚
21:22:20 <petern> No, a plugin to highlight them.
21:22:27 <TrueBrain> ah; I just let VSCode fix it ๐Ÿ˜›
21:22:50 <petern> Turned that on as well now ๐Ÿ˜„
21:23:12 <TrueBrain> a lazy programmer is a good programmer ๐Ÿ™‚
21:25:00 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #10820: Fix #10819, #10811: GetVehicleFromDepotWndPt used widget- instead of window-relative positions. https://github.com/OpenTTD/OpenTTD/pull/10820
21:25:46 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain approved pull request #10820: Fix #10819, #10811: GetVehicleFromDepotWndPt used widget- instead of window-relative positions. https://github.com/OpenTTD/OpenTTD/pull/10820#pullrequestreview-1425461593
21:25:47 <TrueBrain> I am sure you tested it ๐Ÿ˜›
21:26:06 <petern> I even successfully compiled it ๐Ÿ˜‰
21:26:15 <andythenorth> and wrote tests!
21:26:30 <petern> Errr
21:26:38 <petern> That doesn't look testable right now.
21:26:57 <TrueBrain> hmm, my strongtypedef is twice the size it should be on Windows .. interesting
21:27:26 <TrueBrain> all because of that stupid implicit conversion ๐Ÿ˜„
21:27:36 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #10818: Fix: Don't use a loop to test if NewGRF class is valid. https://github.com/OpenTTD/OpenTTD/pull/10818
21:29:38 <TrueBrain> okay, MSVC writes an extra byte for some reason ... interesting ๐Ÿ˜„
21:31:12 <TrueBrain> one byte for every mixin .. do I want to know? ๐Ÿ˜„
21:35:14 <TrueBrain> `__declspec(empty_bases)` resolves the issue
21:35:15 <TrueBrain> lol
21:35:38 <TrueBrain> `This is a longstanding bug in the Visual C++ compiler. When a class derives from multiple empty base classes, only the initial empty base class will be optimized using the empty base optimization (EBO).`
21:35:41 <TrueBrain> ofc MSVC ... ofc
21:36:37 *** m3henry has joined #openttd
21:36:55 <michi_cc[d]> <https://learn.microsoft.com/en-us/cpp/cpp/empty-bases?view=msvc-170> seems to say it is not a bug anymore, just legacy compatibility behaviour by now.
21:37:11 <m3henry> Does cargo value decay as soon as it is loaded into a train, or after the train first leaves the station?
21:37:36 <petern> Oh, commit title :/
21:37:38 <TrueBrain> michi_cc[d]: lol; can't possibly change it now!
21:37:39 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:38:18 <michi_cc[d]> Well, chances are something somewhere in the Windows API depends on this.
21:38:46 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #10820: Fix #10819, #10811: GetVehicleFromDepotWndPt used widget- instead of window-relative positions. https://github.com/OpenTTD/OpenTTD/pull/10820
21:39:30 <TrueBrain> at least I now know how to fix this in my PR ๐Ÿ™‚
21:39:56 <TrueBrain> no clue yet how to fix settings .. they silently cast to and from the base type
21:40:05 <TrueBrain> which works for tileindex, but not for my date/year ๐Ÿ˜›
21:40:26 <TrueBrain> guess, like the endianbuffer, I should just hardcode it in the saveload to still accept these types, and just pickly out the value
21:41:41 <TrueBrain> but, that is for another day ๐Ÿ™‚ Enough templating for one evening .. this was fun ๐Ÿ˜„ (well, "fun" :P)
21:42:35 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain updated pull request #10761: Codechange: make TimerGameCalendar types strongly typed https://github.com/OpenTTD/OpenTTD/pull/10761
21:42:38 <michi_cc[d]> Templates is usually feeling completely stupid for hours and hours, but when it finally works, you can feel like king for a moment ๐Ÿ™‚
21:42:52 <TrueBrain> exactly! Really happy these mixins work
21:43:09 <TrueBrain> makes it a bit more readable while keeping it optional ๐Ÿ˜„
21:43:44 <TrueBrain> and it would just be nice if we can have a bit more stronger types in certain places .. would really help out the code (without losing speed)
21:44:23 <TrueBrain> well, I am sure compiling takes a bit longer, but we have a bit more time now given someone enabled precompile headers ๐Ÿ˜›
21:57:18 <petern> Hmm, sometimes refactor takes ages. I guess searching so many files ๐Ÿ˜„
21:59:06 <DorpsGek> [OpenTTD/OpenTTD] github-code-scanning[bot] commented on pull request #10817: Feature: [GS] Goal destination can be updated https://github.com/OpenTTD/OpenTTD/pull/10817#pullrequestreview-1425466341
22:03:16 *** tokai has joined #openttd
22:03:16 *** ChanServ sets mode: +v tokai
22:09:59 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
22:13:45 <petern> ```/usr/bin/ld: /usr/bin/ld: DWARF error: could not find variable specification at offset c21
22:13:45 <petern> /usr/bin/ld: DWARF error: could not find variable specification at offset 2009```
22:13:47 <petern> Oops ๐Ÿ™‚
22:15:03 *** Flygon has joined #openttd
22:17:53 <petern> Okay, turns out this unused function is still needed for during linking apparently.
22:18:40 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #10820: Fix #10819, #10811: GetVehicleFromDepotWndPt used widget- instead of window-relative positions. https://github.com/OpenTTD/OpenTTD/pull/10820
22:18:43 <DorpsGek> [OpenTTD/OpenTTD] PeterN closed issue #10819: [Bug]: Cannot clone a train https://github.com/OpenTTD/OpenTTD/issues/10819
22:35:19 *** patrick[m] has quit IRC (Quit: Client limit exceeded: 20000)
23:33:26 *** argoneus has joined #openttd
23:33:42 *** argoneus has quit IRC ()
23:33:56 *** argoneus has joined #openttd
23:41:55 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #10821: Codechange: Use std::move for bridge list. https://github.com/OpenTTD/OpenTTD/pull/10821