IRC logs for #openttd on OFTC at 2025-03-26
            
00:19:02 *** WormnestAndroid has quit IRC (Remote host closed the connection)
00:19:04 *** WormnestAndroid has joined #openttd
02:54:39 *** Wormnest has quit IRC (Quit: Leaving)
03:00:08 *** herms has quit IRC (Quit: bye)
03:03:50 *** herms has joined #openttd
03:09:24 *** geizeskrank has quit IRC (Ping timeout: 480 seconds)
03:10:04 *** akimoto has quit IRC (Remote host closed the connection)
03:12:55 *** geizeskrank has joined #openttd
03:52:26 *** D-HUND has joined #openttd
03:55:49 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:44:26 <DorpsGek> [OpenTTD/OpenTTD] eints-sync[bot] pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/df750d44fd979d65b5126abcb686786a33745a90
04:44:27 <DorpsGek> - Update: Translations from eints (by translators)
05:08:29 *** keikoz has joined #openttd
05:24:45 <pickpacket> Rubidium, frosch123: thank you muchly for helping me with my PR 😊 and also SamuXarick
05:42:00 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13862: Codechange: Use std::string_view in FormatString, and validate string bounds while parsing https://github.com/OpenTTD/OpenTTD/pull/13862#pullrequestreview-2715942307
06:25:31 *** keikoz has quit IRC (Ping timeout: 480 seconds)
06:50:19 *** akimoto has joined #openttd
07:00:14 *** Flygon has joined #openttd
07:13:09 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
08:29:35 *** mindlesstux has quit IRC (Quit: The Lounge - https://thelounge.chat)
08:30:01 *** mindlesstux has joined #openttd
08:35:00 *** mindlesstux has quit IRC (Quit: The Lounge - https://thelounge.chat)
08:35:53 *** mindlesstux has joined #openttd
08:54:26 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13896: Fix #10179: [Script] Only start GameScripts in-game https://github.com/OpenTTD/OpenTTD/pull/13896#issuecomment-2753640795
09:25:14 <xarick> hmm, i wonder something
09:25:19 <xarick> the saved data
09:27:06 <xarick> if the instance isn't started... the saved data goes poof!
09:50:33 <xarick> dang, it's a bad fix
09:50:40 <xarick> sorry
09:52:32 <xarick> i suspect there might be a problem with AI's too, let me test
09:55:08 <pickpacket> What's the current release plan for 15.0-beta2 or 15.0?
09:55:45 <LordAro> gets pushed back a week any time someone asks
10:01:13 <pickpacket> LordAro: so what is it now?
10:01:17 <pickpacket> Or now?
10:01:24 <pickpacket> πŸ˜‰
10:11:24 * peter1138 wibbles
10:21:09 <xarick> strange that im not getting a crash on AIs
10:21:17 <xarick> possibly depends on the ai?
10:21:46 <xarick> it's doing the exact same thing
10:27:33 <peter1138> /usr/include/c++/12/bits/unique_ptr.h:93:23: error: invalid application of β€˜sizeof’ to incomplete type β€˜GRFConfig’
10:27:36 <peter1138> Hmm.
10:28:35 <peter1138> So there's a unique_ptr with an incomplete type, but the class containing that has a non-inlined constructor so it shouldn't matter.
10:29:04 <kuhnovic> It's probably the destructor
10:30:40 <kuhnovic> https://www.fluentcpp.com/2017/09/22/make-pimpl-using-unique_ptr/ Read the "Destructor visibility" section
10:31:56 <peter1138> Non-inline destructor too.
10:32:21 <xarick> what's the difference in behaviour between Game::GameLoop() and AI::GameLoop()
10:32:37 <xarick> why is AI::GameLoop() paused
10:32:49 <xarick> but Game::GameLoop() always running even when paused
10:36:04 * pickpacket looks at peter1138 and decides to wobble
10:36:07 <xarick> nevermind, it's not running in scenario editor... then what the heck is wrong? Where does it go wrong?
10:36:31 <peter1138> Game script is able to run somewhere.
10:38:09 <peter1138> Got it. It's `= nullptr;`
10:38:38 <peter1138> So we've default initialised it, and that breaks it.
10:38:52 <xarick> ah line 1224 in openttd.cpp
10:39:03 <xarick> I think this is it, let's see...
10:39:05 <peter1138> The annoying C++ rules on when things should and shouldn't be initialised.
10:40:56 <peter1138> We
10:41:14 <peter1138> We blanket initialised things when moving away from ZeroedMemoryAllocator.
10:45:01 <xarick> Game::GameLoop() is called but AI::GameLoop() isn't, in scenario editor, but only sometimes! very strange
10:49:28 <xarick> _pause_mode.Any()
10:49:43 <xarick> sometimes this is true, sometimes this is false
10:50:05 <xarick> this dictates whether Game::GameLoop() is called or not
10:50:21 <xarick> if it is called, changing a GS will end up crashing openttd
10:50:32 <xarick> but it also depends on the GS
10:52:24 <xarick> what is possibly defining _pause_mode?
10:54:20 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13895: Codechange: Use std::unique_ptr for ai/game config. https://github.com/OpenTTD/OpenTTD/pull/13895
10:56:40 <xarick> enum bitset stuff hard for debugging
10:57:02 <xarick> i need a breakpoint in _pause_mode detecting a change
10:57:06 <xarick> how do I do that now?
11:04:38 <xarick> what does _pause_mode == 2 mean?
11:05:49 <peter1138> It's a bitmask, so a value of 2 means bit 1 is set.
11:05:52 <kuhnovic> xarick: Assuming you are running Visual Studio: while debugging, right click _pause_mode and choose "Add Watch". In the watch window, right click the watch and click "Break when value changes".
11:07:56 <xarick> ah I see
11:08:09 <xarick> _pause_mode is also stored in savegames, interesting
11:11:03 <xarick> line 1140 in openttd.cpp - cancel the saveload pausing.
11:12:44 <xarick> _pause_mode on the crash prone savegame from #10179 we get a 3
11:12:58 <xarick> it cancels the saveload pausing, remaining a value of 1
11:13:49 <xarick> 1 != 0 is true, meaning it will call Game::GameLoop() in line 1224 openttd.cpp
11:14:21 <xarick> changing the GS in this circumstance will crash openttd
11:14:49 *** toktik has quit IRC (Remote host closed the connection)
11:15:02 *** toktik has joined #openttd
11:20:30 <peter1138> Anyway, your fix for the gamescript running in scenario editor seems correct at least.
11:20:48 <peter1138> I was querying if anything similar needed to happen for AIs.
11:22:46 <xarick> my fix is bad... because if I don't change the GS, I want the save data to remain once I save the scenario again
11:23:34 <xarick> I have a different idea
11:24:47 <xarick> let it start the instance
11:24:53 <xarick> but don't run gameloop
11:35:07 <xarick> well, changing to something else other than none
11:35:21 <xarick> will still keep the save data of the previous script
11:35:42 <xarick> the new script load function will be trying to load the data of the other script
11:36:04 <xarick> eh...
11:36:32 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354418744012705802/image.png?ex=67e53840&is=67e3e6c0&hm=069970c0aee5fc2b46d52e5a633c5f50572d95e2d9934a18515c28f176ae3694&
11:36:32 <xarick> not an openttd crash at least
11:46:56 <_glx_> If you load a running save game in scenario editor you should expect some weird things with script saved data
11:48:04 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #13896: Fix #10179: [Script] Only run the Game::GameLoop() in-game https://github.com/OpenTTD/OpenTTD/pull/13896
11:55:05 <_glx_> xarick: But if you change the script it's supposed to start a new VM, and to_load data is discarded in this case
11:57:29 <_glx_> Unless some steps are missing
12:00:10 <peter1138> 1) It shouldn't run any script
12:00:31 <peter1138> 2) I think it shouldn't discard anything, unless you make changes to the configuration.
12:02:42 *** keikoz has joined #openttd
12:46:03 *** WormnestAndroid has quit IRC (Remote host closed the connection)
12:46:15 *** WormnestAndroid has joined #openttd
12:56:57 *** WormnestAndroid has quit IRC (Remote host closed the connection)
12:57:01 *** WormnestAndroid has joined #openttd
13:19:54 *** pickpacket6 has joined #openttd
13:23:16 *** pickpacket has quit IRC (Ping timeout: 480 seconds)
13:23:16 *** pickpacket6 is now known as pickpacket
13:41:06 <DorpsGek> [OpenTTD/OpenTTD] 2TallTyler commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2717175685
15:08:40 *** Wormnest has joined #openttd
15:08:48 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
15:08:49 *** WormnestAndroid has joined #openttd
15:12:29 <peter1138> Hmm, nice race condition.
15:23:12 *** nielsm has joined #openttd
15:34:07 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
15:34:08 *** WormnestAndroid has joined #openttd
15:34:10 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
15:34:12 *** WormnestAndroid has joined #openttd
15:34:14 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
15:37:18 *** WormnestAndroid has joined #openttd
15:41:25 <xarick> AIs are harder to deal now, with 2 configs around
15:43:31 <_glx_> not really, if it's started it's in Company else it's in GameSettings
15:43:50 <LordAro> two is more than one
15:45:19 <_glx_> and AIConfig::GetConfig() exists to get the right one
15:47:12 <peter1138> So, `delete this->x; (destructor of x does stuff that accesses this->x); this->x = nullptr;`
15:47:28 <peter1138> Turns out this breaks when x becomes a unique_ptr.
15:48:31 <peter1138> I'm not sure if that's undefined behaviour or not.
15:48:55 <_glx_> weird construct anyway
15:52:36 <xarick> I'm in the scenario editor, I wanna change an AI to another. There are quite some possibilities:
15:52:36 <xarick> - AI was started (company exists), uses company config
15:52:36 <xarick> - AI was not started (company doesn't exist), uses array config
15:53:20 <xarick> what I'm now trying to do is StopAI when i change the config
15:54:03 <xarick> so it ends with:
15:54:03 <xarick> - AI not started (but company exists), what config should I deal with?
15:55:55 <xarick> stopping an AI... calls the c->ai_config.reset(), but the config I just changed seems to be the one on c->ai_config.reset()
15:56:13 <xarick> mayhem!
16:00:43 <_glx_> AI is started, but not really running so changing it "works" except the saved data which still calls old AI Save()
16:01:41 <_glx_> but also stores new info, so it starts the correct one on load with wrong saved data
16:04:05 <xarick> wondering if what I did the other day solves this
16:06:06 <xarick> needs rebase πŸ™‚ <https://github.com/SamuXarick/OpenTTD/tree/do-not-reset-AIConfig-when-reloading-AI>
16:15:32 <_glx_> I think a solution would be to call StartNew() without calling Stop(), but there's an assert in AI:StartNew() (not present in Game::StartNew())
16:16:04 <_glx_> ah it's replaced by an early return
16:17:53 <_glx_> so actually a partial stop is needed
16:18:43 <xarick> this new unique ptr stuff is in my way 😦
16:20:34 <_glx_> that's not a problem, it works as before without requiring manual delete
16:21:01 <xarick> it does not like this: *config = std::make_unique<AIConfig>(c->ai_config);
16:24:04 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354491104397099169/message.txt?ex=67e57ba4&is=67e42a24&hm=a819ec5a3bff025a459b44bcadb019a3c0126f41ab81b630438f68dde561f2f2&
16:25:58 <exceptik> xarick: doesn't work this way, show the whole line
16:26:50 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354491797640052766/image.png?ex=67e57c49&is=67e42ac9&hm=3113ba8bab68feb5f23ddf2dca7f19699b465aed52b96a4dc43a9f2c95ec155b&
16:27:14 <exceptik> w... why do you have a raw pointer to a unique pointer πŸ˜•
16:27:31 <xarick> i don't know anything about pointers
16:28:23 <peter1138> AIConfig's constructor was recently changed to accept a reference instead of a raw pointer.
16:28:34 <peter1138> Therefore, you need to pass the object itself, not a pointer to the object.
16:28:41 <peter1138> exceptik,
16:30:06 <peter1138> exceptik, it should be a reference but the logic doesn't allow that (references can't be changed, pointers can.)
16:30:27 <xarick> `*c->ai_config.get()` okay, this works
16:30:35 <peter1138> I thinK i can reorganise that to make it make more sense, though.
16:39:06 <exceptik> also wouldn't the .reset work better here? if i understand correctly assigning a new u_pointer would leak the old one
16:39:41 <peter1138> Assigning to a unique_ptr does not leak its old pointer.
16:40:24 <exceptik> hmm, according to cppreference it does not call the destructor on the old object πŸ€”
16:41:12 <peter1138> The object is disposed of, using the associated deleter, when either of the following happens:
16:41:15 <peter1138> the managing unique_ptr object is destroyed. the managing unique_ptr object is assigned another pointer via operator= or reset().
16:41:31 <peter1138> Maybe you're reading a different cppreference :)
16:42:21 <exceptik> or me eyes got blurry, ye i see
16:44:40 <exceptik> yeah i guess no more code for today :P
16:46:49 *** ufo-piloot has quit IRC (Ping timeout: 480 seconds)
16:48:09 <_glx_> yeah main goal for unique_ptr is to not manually handle deletion πŸ™‚
16:49:08 *** gelignite has joined #openttd
17:16:53 <_glx_> maybe something like https://github.com/OpenTTD/OpenTTD/compare/master...glx22:OpenTTD:script_scenedit
17:22:40 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13897: Codechange: Use range filter to simplify picking a random AI. https://github.com/OpenTTD/OpenTTD/pull/13897
17:25:21 <xarick> not sure
17:27:10 <xarick> i'd like to do a 2 stones with 1 bird thing
17:27:46 <xarick> solve the reload ai while at it
17:32:52 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #13897: Codechange: Use range filter to simplify picking a random AI. https://github.com/OpenTTD/OpenTTD/pull/13897#pullrequestreview-2718083276
17:33:09 <LordAro> oh wait, damn
17:33:10 <_glx_> but the reload is not really a bug, it works as intended (maybe not like you would want it to work)
17:33:54 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on pull request #13897: Codechange: Use range filter to simplify picking a random AI. https://github.com/OpenTTD/OpenTTD/pull/13897#pullrequestreview-2718085843
17:34:57 *** Wolf01 has joined #openttd
17:35:04 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13897: Codechange: Use range filter to simplify picking a random AI. https://github.com/OpenTTD/OpenTTD/pull/13897#pullrequestreview-2718092717
17:36:32 <DorpsGek> [OpenTTD/OpenTTD] glx22 commented on pull request #13896: Fix #10179: [Script] Only run the Game::GameLoop() in-game https://github.com/OpenTTD/OpenTTD/pull/13896#issuecomment-2755218333
17:43:02 <xarick> let me check StartNew approach
17:44:01 <_glx_> it's like start/stop but without resetting the config
17:45:32 <_glx_> I guess it could also work for your restart ai using current config
17:47:57 <_glx_> current way is actually restart slot, while you want to restart the running AI ignoring slot config
17:50:31 <_glx_> that's something CTRL and the new StartNew could do I think
17:52:02 <_glx_> but it would bypass the commands, and that's bad
17:53:27 <_glx_> also means the stuff already built by AI would still be there
17:54:05 <xarick> I suppose that's okay
17:54:14 <xarick> keep the infrastructure
17:55:04 <xarick> not ideal but... if you're already going that far
17:55:27 <_glx_> not touching it πŸ™‚ just thinking
17:58:59 <_glx_> but it's a possible way to restart the AI without any saved data, useful if using dev version and the new one doesn't understand saved data from older version (and crashes)
18:00:03 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354515258936524850/image.png?ex=67e59223&is=67e440a3&hm=e6324e709159659ef68c885e7b9b0624bf3e6fa6d105a6710a5b5e82ee22a260&
18:00:03 <xarick> I selected RandomAi, it picked it up immediately... not good
18:00:36 <_glx_> company exists, so a new script is launched
18:01:29 <_glx_> RandomAI is only true for not started slots
18:01:53 <_glx_> here we are modifying config of companies
18:02:23 <_glx_> and a company always has a real script
18:03:24 <_glx_> if you change a not yet started company it will stay random
18:11:02 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13898: Codechange: Pass NewsItem by reference. https://github.com/OpenTTD/OpenTTD/pull/13898
18:11:43 <DorpsGek> [OpenTTD/OpenTTD] LordAro approved pull request #13898: Codechange: Pass NewsItem by reference. https://github.com/OpenTTD/OpenTTD/pull/13898#pullrequestreview-2718228518
18:19:25 <xarick> oops, ai debug window requires the instance->engine to not be null
18:32:19 *** ufo-piloot has joined #openttd
18:34:09 <xarick> I'm setting my PR ready to review
18:34:31 <xarick> don't think i can solve the load problem easily today
18:34:47 <xarick> but that part at least is okay, according to you
18:41:49 <xarick> AI events are triggering crashes in openttd... this is complex
18:41:54 <xarick> πŸ™‚
18:42:07 *** tokai has joined #openttd
18:42:07 *** ChanServ sets mode: +v tokai
18:42:27 <xarick> apparently the instance must exist if the company exists
18:43:15 <xarick> so my PR is still fine for that, it doesn't remove the instance, it just doesn't let it loop
18:49:10 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
18:56:37 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13898: Codechange: Pass NewsItem by reference. https://github.com/OpenTTD/OpenTTD/pull/13898
19:47:44 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13899: Codechange: Use EnumBitSet for GoodsEntry status. https://github.com/OpenTTD/OpenTTD/pull/13899
20:36:22 <xarick> what the difference between config == nullptr and config.empty()
20:40:21 <LordAro> lots
20:43:15 <xarick> i forgot how to detect current ai is random
21:00:40 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354560712521023691/image.png?ex=67e5bc78&is=67e46af8&hm=658cdaa797a7fd20935385fbb42c4d155df1555222d2c9276bc99977b47288fe&
21:00:40 <xarick> error C2102: '&' requires l-value
21:01:09 <xarick> pointers
21:07:52 <_glx_> what you are writing makes no sense πŸ™‚
21:09:09 <xarick> yeah, the probability of making no sense was high
21:09:15 <xarick> I have no idea what to write
21:09:29 <xarick> I was trying to replace `std::unique_ptr<AIConfig> *new_config = &GetGameSettings().script_config.ai[company];`
21:09:44 <_glx_> first it's `std::unique_ptr<XXX> name`
21:10:11 <xarick> oh
21:12:16 <_glx_> and writing code without understanding what you are doing is silly πŸ˜‰
21:12:31 <DorpsGek> [OpenTTD/OpenTTD] PeterN opened pull request #13900: Codechange: Simplify AI/GameConfig::GetConfig. https://github.com/OpenTTD/OpenTTD/pull/13900
21:16:20 <xarick> peter is saving me
21:16:22 <xarick> probably
21:18:52 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #13900: Codechange: Simplify AI/GameConfig::GetConfig. https://github.com/OpenTTD/OpenTTD/pull/13900#pullrequestreview-2718642581
21:20:18 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 approved pull request #13899: Codechange: Use EnumBitSet for GoodsEntry status. https://github.com/OpenTTD/OpenTTD/pull/13899#pullrequestreview-2718644967
21:20:24 <peter1138> If it works and has the same behaviour, yeah.
21:20:39 <_glx_> logic seems fine to me
21:22:37 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13899: Codechange: Use EnumBitSet for GoodsEntry status. https://github.com/OpenTTD/OpenTTD/pull/13899
21:27:13 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718657328
21:28:26 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718659184
21:29:41 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 updated pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738
21:30:55 <xarick> nope, didn't work
21:31:26 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718663966
21:32:24 <xarick> the new_config went into the trash bin
21:32:34 <xarick> should have gone to the array
21:32:35 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718665804
21:33:33 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718667330
21:33:49 <xarick> the code which makes no sense should work
21:34:29 <xarick> but requires an L value
21:34:41 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:38:03 <peter1138> Is that a comment about #13900?
21:38:32 <xarick> no
21:38:53 <xarick> it's about my pointers failing
21:39:02 <peter1138> Ok :)
21:39:57 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354570596591210626/image.png?ex=67e5c5ac&is=67e4742c&hm=d466cdffaf2697bd8d1a7ec6877c85482af2be1410d5d5336eef8bf85b008d82&
21:39:57 <xarick> clang gives me a better error:
21:40:32 <DorpsGek> [OpenTTD/OpenTTD] rubidium42 commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718678074
21:44:02 <DorpsGek> [OpenTTD/OpenTTD] PeterN commented on pull request #13738: Update: changelog for 15.0-beta2 https://github.com/OpenTTD/OpenTTD/pull/13738#pullrequestreview-2718683146
21:45:17 <peter1138> Hmm, so -Wundefined-var-template.
21:45:42 <peter1138> Seems users disable the warning because it's a pain, but the author that added the warning says it's correct.
21:47:12 <peter1138> (users of the compiler that is :))
21:50:05 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354573146879033486/image.png?ex=67e5c80c&is=67e4768c&hm=4405f1541cfc1c36483af1068af5e6cacecb885e4dda385bee2417f9b6535701&
21:50:05 <xarick> I can only make it work with this code 😦
21:50:58 <xarick> AI::Config::GetConfig etc... can't make it work
21:52:05 <xarick> let me look at your code
21:53:08 <DorpsGek> [OpenTTD/OpenTTD] PeterN merged pull request #13900: Codechange: Simplify AI/GameConfig::GetConfig. https://github.com/OpenTTD/OpenTTD/pull/13900
21:53:15 <xarick> well cool i guess
22:01:07 <DorpsGek> [OpenTTD/OpenTTD] glx22 opened pull request #13901: Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance() https://github.com/OpenTTD/OpenTTD/pull/13901
22:01:10 <DorpsGek> [OpenTTD/OpenTTD] PeterN updated pull request #13856: Codechange: Use template traits to define BaseSets. https://github.com/OpenTTD/OpenTTD/pull/13856
22:02:44 <DorpsGek> [OpenTTD/OpenTTD] PeterN approved pull request #13901: Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance() https://github.com/OpenTTD/OpenTTD/pull/13901#pullrequestreview-2718711180
22:08:34 <xarick> I asked Mr Copilot about... #13900
22:09:04 <xarick> https://copilot.microsoft.com/shares/k7Nsj41SHHieHiDWndXar
22:09:41 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354578081452392640/image.png?ex=67e5cca5&is=67e47b25&hm=7b15cb5f1c4452d4e6ce1c5bdfbe0eec064add00a1cc7d78fed36a022e70515d&
22:10:15 <_glx_> xarick: this compile but the code clearly won't work
22:14:12 <_glx_> you just need to do something similar to AIConfig::GetConfig (ie use references)
22:19:48 <xarick> the new version of AIConfig? or the old?
22:19:58 <_glx_> the new one, it's simpler
22:20:47 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:39:19 <xarick> https://cdn.discordapp.com/attachments/1008473233844097104/1354585536538476636/image.png?ex=67e5d396&is=67e48216&hm=ac5e85b0c9fb91d21b3816deb90a62e3c9c2614b140b972a737507d4d5fc98f9&
22:39:19 <xarick> this compiled, let's see if it does what I want
22:41:45 <DorpsGek> [OpenTTD/OpenTTD] glx22 merged pull request #13901: Codechange: Remove Game::GetGameInstance() (duplicate of Game::GetInstance() https://github.com/OpenTTD/OpenTTD/pull/13901
22:42:16 <_glx_> you are writing silly overcomplicated things
22:42:24 <xarick> nope, doesn't do what i want
22:43:55 <xarick> it's treating new_config as not being part of the array of configs
22:44:23 *** gelignite has quit IRC (Quit: Stay safe!)
22:44:26 <_glx_> auto &new_config = GetGameSettings().script_config.ai[company];
22:44:26 <_glx_> if (new_config.GetInfo() != nullptr) {
22:44:26 <_glx_> new_config = std::make_unique<AIConfig>(*current_config);
22:44:26 <_glx_> }
22:45:24 <xarick> hmm, there's no way around GetGameSettings() ?
22:45:47 <_glx_> no
22:45:48 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
22:45:52 *** WormnestAndroid has joined #openttd
22:46:21 <_glx_> you want to modify the storage, AIConfig::GetConfig returns the content
22:49:29 <_glx_> but you can replace `GetGameSettings()` with `_settings_game` since it's a running game anyway
22:49:42 <xarick> pointers are my downfall ^-_-^
22:49:58 <_glx_> pointers and references are basic stuff
23:00:37 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
23:22:47 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #13565: Add #13519, e4c511d: [Script] Saveload and config file support for handpicked configs https://github.com/OpenTTD/OpenTTD/pull/13565
23:35:47 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick dismissed a review for pull request #13665: Codechange: Code style changes to AI/GS GUI files https://github.com/OpenTTD/OpenTTD/pull/13665#pullrequestreview-2714651884
23:35:50 <DorpsGek> [OpenTTD/OpenTTD] SamuXarick updated pull request #13665: Codechange: Code style changes to AI/GS GUI files https://github.com/OpenTTD/OpenTTD/pull/13665
23:40:08 <xarick> okay, bed, good night
23:47:34 *** Flygon has quit IRC (Read error: Connection reset by peer)