IRC logs for #openttd on OFTC at 2025-11-05
⏴ go to previous day
00:10:20 <xarick> I'll write some tests suitable for regression tomorrow
00:10:29 <xarick> gonna sleep, cyas good night
01:41:20 *** Webster has quit IRC (Ping timeout: 480 seconds)
01:55:11 *** Smedles has joined #openttd
02:53:11 *** Wormnest has quit IRC (Quit: Leaving)
03:13:57 *** Zathras_4 has joined #openttd
03:54:19 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:13:12 *** baricus has joined #openttd
04:13:12 <baricus> This is perhaps a silly question, but are vehicles only stored in the vehicle pool? I was working on a PR and have to pick one vehicle from every one in the map that meets certain conditions. The best way I have found is to just use `Vehicle::Iterate` and check, but that feels like I'm misusing things?
04:14:07 <baricus> I'm mainly trying to get all vehicles of a certain type within a rectangle on the map; I can do the filter but wanted to double check that there isn't some better way I don't know
04:14:12 <baricus> I'm not super familiar with the OpenTTD codebase
04:15:47 <baricus> and I suppose one other, unrelated question, but is there a better way to schedule something to run on every frame outside the timer system? I'm pretty sure I'm misusing that and have to look into the main game loop more but figured I should ask.
04:32:57 *** Zathras_11 has joined #openttd
04:33:00 *** Zathras_1 has joined #openttd
04:36:20 *** Zathras_4 has quit IRC (Ping timeout: 480 seconds)
04:36:30 *** Zathras has quit IRC (Ping timeout: 480 seconds)
05:49:09 *** keikoz has quit IRC (Ping timeout: 480 seconds)
08:13:59 <kuhnovic> baricus: Sounds like you need VehiclesNearTileXY
09:09:07 *** reldred has quit IRC (Quit: User went offline on Discord a while ago)
09:37:56 *** orudge` has joined #openttd
09:37:57 *** ChanServ sets mode: +o orudge`
10:46:58 <xarick> what is the commit tag for adding tests for regression?
11:02:39 <xarick> funny, that `while` test is testing nothing!
11:02:55 <xarick> is that supposed to be that way?
11:03:20 <xarick> nevermind, list is not empty, but it is already at !list.End
11:12:46 <xarick> why are we printing the opposite value of list.IsEnd?
11:32:29 *** WormnestAndroid has quit IRC (Remote host closed the connection)
11:32:45 *** WormnestAndroid has joined #openttd
12:40:37 <Borg> hey. an idea popped in here
12:40:52 <Borg> How hard it would be to allow move of default dual head locos to front?
12:41:14 <Borg> I remember in old openttd I could do that.. from some version. its gone.. I thinking about bringing it back
13:05:26 <Borg> okey time to look at CmdMoveRailVehicle()
13:47:39 <Borg> hah, this is harder that I tought
13:48:19 <kaji_kaede> I mean, that's how it always is, isn't it?
13:54:00 <Borg> I have very hard time working w/ OpenTTD.. because its C++
13:54:11 <Borg> I did a lot of changes to 1ooM (Master of Orion)
13:54:37 <Borg> yeah.. there were some choke points. as always..
13:55:04 <Borg> but ill get there... now im not sure who is b0rking my consist
13:55:12 <Borg> NormaliseDualheads() does sth for sure.
13:55:19 <Borg> but im trying to understand the code there :)
14:03:49 <Borg> ahh its NormaliseDualheads
14:04:04 <Borg> lets fix it.. either back of the train, or right behind front engine
14:17:17 <Borg> okey.. confirmed.. it works
14:17:24 <Borg> but I still dont understand NormaliseDualHeads
14:17:47 <Borg> for (u = t; u->Next() != NULL && !u->Next()->IsEngine(); u = u->Next()) {}
14:17:57 <Borg> that will stop at first spotted engine
14:19:26 <Borg> FL -> W -> W -> BL -> L -> W
14:19:35 <Borg> okey. so when I have it sorted out..
14:25:48 <Borg> at least the part I want works fine
14:26:03 <Borg> either FL -> BL -> W -> W -> L -> W
14:26:07 <Borg> or what I pasted earlier
14:40:50 <Borg> ha fixed! works great.. no more crash
14:41:03 <Borg> added check when moving rear engine out of consist..
14:45:30 *** Wormnest has joined #openttd
15:26:54 <xarick> oh no! "Fix" and not "codefix" ?
15:54:14 *** Smedles has joined #openttd
16:52:25 <perfk> `GSTown.ExpandTown(town_id, houses_to_build);` expands houses and build roads.
16:52:25 <perfk> Is there an option that just expands houses?
16:56:25 <Borg> im not aware of any.. whats wrong w/ this one?
16:57:17 <locosage> kind of is, you can disable building roads in game settings (with gs), run expand and restore the setting value
16:58:28 <locosage> hm, though maybe not
17:00:18 <locosage> not anymore at least
17:00:25 <locosage> I think that worked before 15.0
17:01:25 <locosage> which is actually a problem if it doesn't now as that will break a lot of cb scripts
17:03:55 <xarick> might actually be a good pathologic test actually
17:04:17 <xarick> just need to make it shorter
17:06:42 <locosage> yep, simple cb is broken in 15.0
17:12:39 *** orudge` has quit IRC (Ping timeout: 480 seconds)
17:13:03 <perfk> Borg: I'm trying to build my own road layouts before having the town expand the houses into the new layout. Like what happens when you press the "expand buildings" in the scenario editor.
17:21:43 *** gelignite has joined #openttd
17:23:11 <xarick> AddItem is not a bool...
17:25:31 <xarick> SetValue is... for reasons
17:25:52 <xarick> and it works different than the expectation
17:44:37 <_glx_> doc is clear about that
17:57:20 <xarick> can't Begin return null? squirrel can work with different return types
17:58:30 <_jgr_> See the above PR update
17:59:39 <xarick> ah, you did it! my bad
18:05:22 <xarick> might tank performance... i'll test
18:58:29 <xarick> I have issues about this test:
18:58:29 <xarick> First, the list is already empty, it fails the while condition.
18:58:29 <xarick> Second, it should print the stuff first, and move to Next at the end of the loop for it to be correct, unless it's supposed to be a pathological test.
18:59:41 <xarick> actually, the list is not empty, but the iterator is already at the end, my bad.
20:05:18 *** Borg has quit IRC (Quit: leaving)
20:10:01 *** Beer has quit IRC (Quit: Leaving)
20:12:32 *** Zathras_11 is now known as Zathras
20:14:59 <super_vin> Hi! I found a mistake in one of the french translations. But the french translation team is full... Does anyone knows how I can report the mistake ✅😁?
20:15:47 *** Flygon has quit IRC (Read error: Connection reset by peer)
20:26:30 <Rubidium> super_vin: not sure what the official way is, but I know glx is one of the translators so maybe talking to him might be a good solution?
20:36:27 <super_vin> Rubidium: Okay, thanks!
20:36:56 <Borg> did you try to implement long reserve more hacky why?
20:37:20 <Borg> Im trying to do recursion on ExtendTrainReservation() atm
20:39:08 <_jgr_> I don't really get what you're asking. You can do arbitrarily long reservations with the existing code.
20:39:42 <Borg> _jgr_: yes, I looked at your code.. looks complicated.. it backtracks to last PBS signal.. etc
20:39:54 <Borg> I backported your routing restrictions without long reservation..
20:40:16 <Borg> and now playing around to add it.. but "easier" lets say
20:40:50 <_glx_> super_vin: Well I just fixed a weird one when updating to the recent changes
20:41:00 <Borg> compilation done ;) lets try
20:42:53 <_jgr_> Not sure what you mean about backtracking, can you be more specific about which bit of the code you;re looking at?
20:51:00 <Borg> its been rewritten.. ive been looking for too old code path..
20:51:05 <Borg> cant find that weird function anymore
20:51:13 <Borg> IsSafeWaitingPositionTraceRestrictPreviousSignalCallback
20:51:26 <Borg> I will take a look again at your stuff :)
20:58:41 <_jgr_> I'm assuming that this is some implementation of TraceRestrictProgramInput::PreviousSignalProc, and so is only needed for (rarely used) signal conditionals
20:59:10 <_jgr_> It's not part of any core functionality for actually making the reservation, etc
21:01:16 *** ChanServ sets mode: +v tokai
21:02:07 <Borg> okey, I got confused then. thx
21:02:14 <Borg> anyway.. I will first test my thing..
21:04:38 <Borg> okey. not exacly. sometimes it work correctly, sometimes try get stuck like in reserve through :)
21:08:16 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
21:10:52 <Borg> oh okey. you do recursion of different function.
21:48:55 <Rubidium> andythenorth: yes it was, you should go to work now!
21:52:51 *** emperorkuni has quit IRC (Quit: User went offline on Discord a while ago)
21:58:11 *** Borg has quit IRC (Quit: nite)
22:27:29 *** keoz has quit IRC (Ping timeout: 480 seconds)
22:33:27 <xarick> benchmark marathon before going to bed
22:38:46 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
continue to next day ⏵