IRC logs for #openttd on OFTC at 2016-09-26
⏴ go to previous day
01:31:21 *** ChanServ sets mode: +v tokai
02:19:32 <Samu> and tell me what you think
02:22:03 <Samu> reply there on the topic, I'm off to bed now, cyas goodnight
02:26:38 <Fujk> on the server2 modpack, which mod is overwriting the snow limit setting? In vanilla I can set it but with the mods on, my setting doesn't matter
02:30:33 <Fujk> Seems to be opengfx landscape
03:48:04 *** Supercheese has joined #openttd
04:55:31 *** qwebirc73763 has joined #openttd
04:55:46 <qwebirc73763> ok, guys? we have an issue
04:56:06 <qwebirc73763> are any administrators/ people with the ability to remove a version from the site around?
04:56:47 <qwebirc73763> i thorught it was a false-positive with my Server's virus scanner, but apparently the lastest version (at the LEAST the windows .exe download) is compromised, appears to be a trojan
04:57:05 <qwebirc73763> according to my sysadmin, it ISNT a false positive, as his machien threw up the following:
04:57:05 <qwebirc73763> ClamAV Win.Trojan.Onion-11 20160925 Zillya Trojan.Onion.Win32.1331 20160924
04:59:20 <qwebirc73763> the detection is the the .exe download for openttd 1.6.1
04:59:26 <qwebirc73763> could a few of you guys please check this?
05:01:32 <qwebirc73763> according to my sysadmin the .zip isnt compromised
05:06:58 <qwebirc73763> erm.. anyone actually online? dont want to sound like a twat, and i know false positives DO happen, but he was VERY sure this was a genuine detection?
05:07:39 <sim-al2> Things take a little while on this channel
05:08:00 <sim-al2> Especially a fairly major report like that
05:08:29 <qwebirc73763> fair enough! i just wanted to ensure it was noticed >.>
05:16:34 *** supermop has joined #openttd
05:22:38 <sim-al2> Consider the time right now
05:22:51 <sim-al2> It's late on the US east coast, 11pm
05:23:03 <sim-al2> But still early morning in Europe, on a weekday
05:23:30 <sim-al2> That said, I'm sure this will be seen soon
05:35:01 <qwebirc73763> ive got two people on my case aobut being unable to update the server >.>
08:10:42 *** ConductorCat has joined #openttd
08:42:57 *** sim-al2 is now known as Guest141
08:42:58 *** sim-al2 has joined #openttd
09:11:22 *** sla_ro|master has joined #openttd
09:59:36 *** Stimrol has joined #openttd
10:31:26 *** Biolunar has joined #openttd
10:37:25 *** JacobD88 has joined #openttd
11:15:28 *** Smedles has joined #openttd
11:42:21 *** tycoondemon has joined #openttd
12:29:24 *** Flygon_ has joined #openttd
13:38:14 <Fujk> is it possible to put newgrfs in the openttd directory somewhere instead of in My Documents?
13:40:30 <V453000> I think you just copy your openttd.cfg into the openttd directory
13:40:35 <V453000> and it will make it "portable"
13:40:43 <V453000> - everything is within the folder
13:41:13 *** Lejving has joined #openttd
14:24:11 <Wolf01> \o/ sorted all the uncategorized games on my steam library
14:49:39 <V453000> \o/ wrote my first python script
14:49:43 <V453000> world is going to burn soon
14:56:09 <V453000> goodger: well it is called RenamingAndCropping, but it is just a camouflage name, the actual purpose is doombringing indeed
14:56:38 <goodger> you just need a touchofhate.pyc and you're set
15:14:17 <Eddi|zuHause> V453000: wouldn't be the first program that does something completely different than what it's called :p
15:17:43 <Samu> i'm trying to code the auto-lock a bit differently
16:16:42 *** Alberth has joined #openttd
16:16:42 *** ChanServ sets mode: +o Alberth
17:11:21 *** sla_ro|master has joined #openttd
17:19:57 *** ToBeFree has joined #openttd
17:38:45 *** Lejving has joined #openttd
17:51:43 *** TheMask96 has joined #openttd
17:55:22 <Samu> i am wondering if i can avoid repetition
17:55:57 <Samu> it repeats at lines 86-89 and 95-98
17:59:51 <Alberth> you have the execution in the tile area loop together with the test?
18:00:04 <Alberth> that looks like a bad idea
18:00:37 <Alberth> you want a partial build lock when it fails a test somewhere in the middle of the iteraions?
18:05:24 <Alberth> line 68 doesn't seem needed? rem is always >= 0 ?
18:06:37 <Samu> rem = -1 can be defined before entering the loop
18:07:42 <Alberth> right, I see that now
18:08:19 <Alberth> doing the EXEC case after the complete test succeeded is a good idea at least
18:08:53 <Alberth> and then you can earlier do if (rem < 0) continue;
18:09:25 <Alberth> wc == WATER_CLASS_CANAL <-- you do that test quite often too, maybe test for that earlier?
18:11:33 <Samu> it's complicated, I'm dealing with 3 water classes
18:11:34 <Alberth> line 66, the "else" is not needed, since the "then" before jumps back to the loop
18:12:32 <Alberth> I don't see any trivial ways to improve at least
18:14:03 <Alberth> you can move some code though, line 51 slope_next doesn't seem needed immediately, maybe you can move it closer to first use?
18:14:54 <Samu> placing RIVER or SEA in single line mode shall not try to build lock
18:15:13 <Samu> must needs to check if the tile is clear
18:15:43 <Alberth> IsInclinedSlope(slope) <- line 69, is that needed, it got shot down at line 53 already?
18:17:26 <Samu> line 53 ensures that the slope is either flat or inclined, i thnk
18:17:48 <Samu> or am i seeing it wrong?
18:18:44 <Fujk> is it possible to refit one car, so a train can hold two different cargo with two cars? I can only seem to refit the entire train
18:19:13 <Samu> line 69 wants to ensure the tile is not the flat one
18:23:04 <Samu> [17:00] <@Alberth> you want a partial build lock when it fails a test somewhere in the middle of the iteraions
18:24:02 <Samu> ah, build up to a point where it succeeds?
18:24:10 <Samu> and stop building the part it fails?
18:25:06 <Samu> i'd like to have that, similar to how roads and rails are built
18:25:15 <Samu> but i don't know how to do it
18:26:22 <Samu> currently if it fails at some point, nothing is ever built
18:29:22 <Samu> slope_next is first used at line 63, ok i can move that
18:34:19 <Alberth> Fujk: in the refit window you can select a wagon, or a part of the train
18:35:53 <Alberth> Samu: basically while you test, you change the command such that you'll only build the part that works
18:36:12 <Alberth> that also means you give a cost that fits what you build
18:36:51 <Alberth> if you also have EXEC, in the next loop you perform the modified command, which will completely work, since you modified it
18:37:59 <Alberth> you can even do it in 3 steps, first change the command to the part that works, then do the test and cost estimation, and if you have EXEC, the third step is to actually build it
18:40:52 <Alberth> Samu: line 69 wants to ensure the tile is not the flat one <-- ah, you're correct there, misread line 53
18:48:38 <Wolf01> Is it possible to identify a tree type?
19:01:05 <Samu> i see a way to put the bool water outside
19:07:39 <Wolf01> Also, how do I add a setting?
19:07:49 <Wolf01> Looks like automated now
19:09:56 <Samu> i wonder if permanent rivers could be a game setting
19:10:46 <Samu> some ppl might not like the idea of permanent rivers
19:11:20 <Samu> allow it to be disabled or enabled through a setting
19:13:00 <Alberth> Wolf01: setting specifications are in src/table/*.ini files
19:18:50 <Alberth> tree_gui.cpp suggests there are more trees in-between this->tree_to_plant = (TreeType)(this->base + widget - WID_BT_TYPE_11);
19:20:09 <Wolf01> Yup, but I would like to know if a tree is a deciduous or an evergreen one
19:20:35 <Alberth> static TreeType GetRandomTreeType(TileIndex tile, uint seed) does it too tree_cmd.cpp
19:20:36 <Wolf01> And since I think trees can have avery kind of graphic they want, they could differ from set to set
19:20:47 <Alberth> that seems likely indeed
19:21:01 <Wolf01> So I'll plant artic trees as evergreen ones
19:21:25 <Wolf01> The main problem is that I found a case where if I return TREE_INVALID it plants cactus
19:22:15 <Wolf01> Also, do I need to do some saveload - after load preparation for new settings?
19:22:55 <Alberth> GRFspecs also say nothing about trees
19:23:15 <Eddi|zuHause> no, afterload is only if you change a setting, not if you add new ones
19:23:37 <Alberth> you'll get the default value I would expect
19:24:46 <Wolf01> That's because I get strange values as default, I put 0..16 with 16 and 8 as defaults for my settings, the value should be SLE_UINT8 but in the interface I get a date
19:25:29 <Eddi|zuHause> you also need to change settings_gui stuff
19:25:40 <Eddi|zuHause> to add your setting to the list
19:25:50 <Eddi|zuHause> and have a properly formatted string
19:26:08 <Wolf01> genworld->Add(new SettingEntry("game_creation.evergreen_min_height"));
19:29:16 <Wolf01> Now I get "valuables" and "mail"
19:31:11 <Wolf01> Btw, the result is pleasing
19:31:46 <Wolf01> Maybe too "exact" I should give a bit of randomness
19:40:12 *** frosch123 has joined #openttd
19:47:32 <Samu> which trees should i look at?
19:48:27 <Samu> i see similar trees around the mountain, but not anywhere else
19:49:58 *** gelignite has joined #openttd
19:50:24 <frosch123> is that terraform without clearing trees?
19:52:04 <Samu> min height for evergreen trees, i thnk
20:00:46 *** Progman has joined #openttd
20:02:22 *** HerzogDeXtEr has joined #openttd
20:12:09 <Samu> bool water is not repeated
20:12:50 <Samu> and a int tile_delta just before building lock
20:16:56 <Wolf01> <Samu> min height for evergreen trees, i thnk <- that, also "no trees above x height"
20:17:53 <Wolf01> Btw is more "min trees for arctic trees"
20:18:37 <Wolf01> And a bit of randomness of the height
20:18:56 <Wolf01> So it's not a straight line
20:21:30 <Samu> hey, while you're on the matter of trees
20:21:50 <Samu> there's a strange tree growth behaviour on desert tileset, on coastal tiles
20:22:00 <Samu> they spawn too often there
20:22:15 <Wolf01> Usually trees spawn near water
20:22:54 <Wolf01> It's not that they grow too often there, is that they can't grow often enough anywhere else
20:24:15 <Wolf01> Mmmh, settings don't work, maybe I'm stupid enough
20:25:57 <Wolf01> At least now I got "undefined string" and the right widgets to select numbers
20:26:09 <Samu> http://imgur.com/a/uhwl1 - i generated a random scenario without trees, then fast forwarded for a bit and trees start spawning. the growth towards the north coast is different than the growth at the south coast.
20:26:35 <Wolf01> It looks realistic to me
20:27:03 <Wolf01> Maybe more trees along rivers would be cool
20:27:24 <Samu> don't you find odd that the north coast gets trees and the south doesn't?
20:28:53 *** andythenorth has joined #openttd
20:29:06 <Wolf01> Btw, I find strange that I don't see any cactus
20:51:14 *** FLHerne has joined #openttd
20:57:08 <Wolf01> Should evergreen trees height be clamped to snow line height?
21:04:07 <Wolf01> I really don't get the settings
21:04:39 <V453000> andythenorth: fear my shit
21:04:44 <V453000> coded my first python script today
21:06:50 <Fujk> is there a mod that reduces tree spawning? both options spawn way too many
21:07:18 <Wolf01> No, but you can make them invisible
21:13:25 <andythenorth> front looks badass
21:15:31 <Wolf01> Grrrrr.... how does this thing works?
21:21:05 <Samu> hmm MakeLock, will bring it back
21:24:33 <Wolf01> Alberth, do you know how this settings stuff works?
21:25:04 <Alberth> somewhat, I wrote the generator :p
21:25:21 <Alberth> but it got modified afterwards :p
21:25:50 <Wolf01> It still prints "(undefined string)"
21:26:14 <Alberth> iirc it has help strings etc
21:26:16 <Wolf01> An if I click on it I get a "17" as value instead of 24
21:26:23 * andythenorth puzzles over cdist
21:26:37 <Alberth> did you run the generator after modifying?
21:26:46 <Alberth> should run by itself though
21:26:51 <andythenorth> I have transfer stations, to which I’ve added new destinations
21:27:03 <Wolf01> It should run automatically, I can see the modified values on settings.h
21:27:14 <andythenorth> and it would be nice if cargo was allocated to those destinations
21:27:29 <Alberth> andythenorth: further away than the others?
21:27:46 <andythenorth> but distance effect is 0% anyway
21:28:09 <Alberth> hmm, maybe that's the problem andy :p
21:28:10 <andythenorth> maybe the graph is being calculated too aggressively
21:28:27 <Alberth> but computation takes time, and then new cargo must arrive there, before you see the effect
21:29:04 <Alberth> strings are also in the language files?
21:29:13 <Alberth> they have been rebuilt too?
21:29:30 <andythenorth> ran a vehicle over the route, that seemed to trigger a recalculation
21:29:40 <andythenorth> unless it was a coincidence
21:29:56 <andythenorth> afaik, with distance effect 0%, the demand is levelled over all valid destinations
21:30:10 <andythenorth> so cargo should be split 50% to each (there are 2)
21:31:10 <andythenorth> I have both recalculation props set to default
21:31:41 <Alberth> Wolf01: you can have a look at the generated code, but that likely works too, as stuff compiles
21:31:57 <Alberth> afaik "(undefined string)" is a runtime thingie
21:32:20 <Alberth> perhaps put a break point there, and see what it's doing at that time?
21:32:36 <Wolf01> I found some particular threatment for other values, but mine is just numeric
21:32:50 <Alberth> ie maybe it does some weird calculation that you messed up now
21:32:55 <Wolf01> Maybe I have the wrong string, I put {STRING2}
21:33:19 <Alberth> that eats 2 arguments, iirc
21:33:32 <Samu> static inline void MakeLock(TileIndex t, Owner lock_owner, Owner canal_owner_lower, Owner canal_owner_upper, Owner canal_owner_middle, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
21:33:46 <andythenorth> game appears to recalculate link graph within 1 game month or less
21:34:06 <Wolf01> I copied from "river_amount" which is the setting just above mine
21:34:38 *** Chaoticly has joined #openttd
21:34:58 <andythenorth> FIRS builds petrol stations next to roads
21:35:03 <andythenorth> but also next to tram tracks :P
21:35:22 <sim-al2> Dem gas trams would be happy
21:35:31 <andythenorth> $someone should fix that
21:35:36 <Samu> currently canal_owner_middle is the same as lock_owner, since it's not possible to build "canal" on slopes
21:35:43 <sim-al2> Seems like a fire hazard for steamers though 0.o
21:36:54 <Alberth> Wolf01: they all do it, so that seems fine, maybe it uses the wrong sub-string or so?
21:37:17 <Samu> static inline void MakeLock(TileIndex t, Owner lo, Owner co_lower, Owner co_upper, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
21:37:17 <Wolf01> But I don't know where I should change
21:37:37 <Wolf01> Other settings seem only have the world generation gui in common
21:37:39 <Alberth> set a break point on undefined string, that should give you a stack trace
21:39:19 <Alberth> strings.cpp lines 220 and 263 look promising
21:39:40 <Alberth> but I didn't check context
21:40:27 <Alberth> or maybe even on painting the widget, but that's a bit tricky perhaps
21:49:43 <Samu> water_map.h also has the canal owner stuff
21:50:51 <Samu> oops, description is missing something
21:52:31 <Samu> MakeLockTile(t, lo, lo, LOCK_PART_MIDDLE, d, wc_middle);
21:53:20 <Wolf01> Ok, min=1, max=32, default=0x00000018, str_val=0
21:55:39 <Wolf01> Default not really normal, it should be 24
21:55:43 <Samu> MakeLock(tile, _current_company, oc_lower, oc_upper, dir, wc_lower, wc_upper, wc_middle);
21:55:50 <Samu> not too big as I expected
21:56:12 <Samu> this means I don't need oc_middle for anything
22:01:08 <Samu> question, why is there a DoBuildLock and a CmdBuildLock? why not combine both in CmdBuildLock?
22:02:22 <Alberth> Samu: likely DoBuild gets used elsewhere
22:03:05 <Samu> DoBuildLock depends on CmdBuildLock as far as I understand
22:03:35 <Alberth> you've looked 100% longer at that code than I have :)
22:03:40 <Wolf01> Still wrong value, read from "int32 value = (int32)ReadValue(var, sd->save.conv);" is 17
22:04:15 <Alberth> hmm, incremented savegame number?
22:04:33 <Samu> feels like DoBuildLock is the continuation of CmdBuildLock, was split into 2 functions, but why? :(
22:04:45 <Wolf01> Nothing in openttd.cfg
22:05:14 <Wolf01> I'm on title menu, so it might be the title game
22:05:17 <Alberth> you need a successful exit for openttd.cfg update
22:06:05 <Samu> Find all "DoBuildLock", Find Results 1, Entire Solution, "" D:\OpenTTD\trunk\src\water_cmd.cpp(361):static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag flags) D:\OpenTTD\trunk\src\water_cmd.cpp(553): return DoBuildLock(tile, dir, flags); Matching lines: 2 Matching files: 1 Total files searched: 1052
22:06:09 <Wolf01> Also, 17 is a good value, it can go from 1 to 32
22:07:14 <Samu> i'm gonna move DoBuildLock into CmdBuildLock, then get rid of DoBuildLock, see what happens
22:07:51 <Wolf01> I think the "ResolveVariableAddress returns the wrong variable
22:09:49 <Alberth> did some refactoring there, but can't say I understand what it does
22:10:12 *** Chaoticly has left #openttd
22:10:32 <Alberth> although it would open the option to add nifty new features :p
22:12:55 <Alberth> hmm, typing "git" when you mean "hg" isn't a good thing :p
22:13:19 <Wolf01> I really can't understand, it looks right until DrawString()
22:13:50 <Wolf01> I'm debugging on the DrawSetting
22:14:22 <Alberth> so it might be STRING2 after all?
22:14:35 <Wolf01> It's the same in "snow_line_height"
22:15:17 <Alberth> sorry, I have no idea either
22:16:08 <Wolf01> Maybe it will do the trick?
22:17:14 <Wolf01> I can't understand the wrong default values
22:17:35 <Wolf01> Should be 24 and 16, I got 17 and 10
22:19:37 <andythenorth> my Sam plan doesn’t survive first gameplay test :P
22:21:25 <Samu> I killed a function and the game still compiles :)
22:23:51 <Samu> i also killed MakeLock the other day, but now I brought it back, makes more sense to have it
22:25:28 <andythenorth> 240t and 576t ships work fine
22:25:46 <andythenorth> but I want more 100t types - tanker, reefer etc, not just a generic multi-purpose 100t freighter
22:26:04 <andythenorth> especially for secondary or tertiary cargos, which are available in smaller amounts than primary
22:26:23 <peter1138> should i dust off my dev environment?
22:26:39 <andythenorth> you’re going to make ship newgrf? o_O :P
22:27:41 <Alberth> nah, just add more patches to the collection :)
22:28:18 * andythenorth made a patch once
22:28:57 <andythenorth> :o I have not done a single BB goal in this game
22:32:05 <Alberth> you can't do worse any more either :)
22:33:39 <andythenorth> I made my own routes
22:33:52 *** smoke_fumus has joined #openttd
22:34:16 <Wolf01> Ok, saving the setting works, so I don't really know were the wrong value came from
22:34:53 <Wolf01> Now, I look to generate more look alike trees in patches
22:37:20 <andythenorth> my game needs multi-docks
22:38:15 <Wolf01> Did you see the new leaked technic sets?
22:39:19 <Samu> changing variable names again, making their naming more consistent with the rest of the code
22:39:33 <Samu> static inline void MakeLock(TileIndex t, Owner o, Owner oc_lower, Owner oc_upper, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
22:40:47 <peter1138> hmm right can't be arsed
22:42:43 <Samu> there is no MakeShipDepotTile
22:42:59 <Samu> code isn't consistent :(
22:43:08 <Samu> the style or whatever u call it
22:44:57 <andythenorth> peter1138: well you could :)
22:45:07 <andythenorth> Wolf01: yes, not much to say about them
22:45:32 <Wolf01> The Ripsaw imitation looks cool
22:45:58 <Wolf01> The BMW bike... another licensed set which will coost too much
22:46:13 <andythenorth> I have a technic bike, unlikely to ever buy another
22:46:25 * andythenorth should take more lego sets apart
22:46:33 <andythenorth> boring leaving them built up
22:47:11 <Wolf01> You should always buy 2 bikes, so you can have more tyres
22:47:45 <andythenorth> rip saw looks interesting, playability depends on performance
22:48:57 <andythenorth> I built a simple track vehicle with 2 M motors, that was quite fun
22:56:49 <Samu> interesting, aqueducts don't need canal owner
22:57:01 <Samu> it always belong to the same company
23:03:41 <Samu> oh, right, object tiles and industry tiles, brb
23:05:52 <Samu> static inline void MakeIndustry(TileIndex t, Owner oc, IndustryID index, IndustryGfx gfx, uint8 random, WaterClass wc)
23:06:09 <Samu> industries have canal owners
23:07:17 <Wolf01> That could be nice too
23:07:48 <Wolf01> Do you have any suggestion about finding the nearest tile with a tree?
23:08:00 <Eddi|zuHause> other than a circular search?
23:08:03 <Wolf01> I'm looking at CircularTileSearc
23:08:21 <Eddi|zuHause> never really looked at that
23:09:25 <supermop> Eddi|zuHause: the dwarf tree look would be more convincing if there wasn't bright green grass on every mountain peak then
23:09:27 <Wolf01> It's used to launch a callback which does something on the found tile
23:09:58 <Wolf01> My callback only does "return IsValidTile(t) && IsTileType(t, MP_TREES);"
23:10:25 <Eddi|zuHause> that doesn't sound right
23:10:42 <Wolf01> It's the opposite of what I want to do
23:11:26 <Wolf01> I have a tile on which I need to plant a tree on, and I want to search if a tile in a radius of 2 has a tree, so I'll use that tree type
23:14:49 <Eddi|zuHause> you can use *user_data to store the found tile
23:15:24 <Wolf01> Oh, nice, I was using a static global variable
23:15:44 <Eddi|zuHause> or the tree type of that tile
23:16:45 <Samu> gonna increase the height of bridges over locks, someone requested it to be higher
23:17:42 <Samu> ah, are you going to draw the vehicles correctly on the bridge?
23:17:44 <Eddi|zuHause> well, in compiler construction you learn to think in passing around such references and second-order functions through algorithms
23:18:16 <Eddi|zuHause> that's how CETS works, as well :)
23:18:49 <Eddi|zuHause> supermop: bright green grass needs to be solved separately
23:19:12 <Wolf01> TreeType found_tree = *(TreeType*)user_data; <- this really is nonsense for me, without copying from another piece of code I wouldn't have done that
23:19:16 <supermop> if we want to get pedantic, grass should be its own type of tree
23:19:18 <Eddi|zuHause> supermop: you could technically use the arctic grass, but the problem is, there are no transition tiles
23:19:36 <supermop> shouldbe be solid grassy meadows under a dense forest
23:19:54 <Eddi|zuHause> supermop: alternatively, you could turn all tiles above the tree line into rocks
23:20:18 <Wolf01> That's another step, but for the terrain generator
23:20:32 <Eddi|zuHause> supermop: well, forests use an incomplete grass, could use that same grass if there is more than one tree on the tile
23:20:46 <supermop> but then its natural that towns be more upset about loss of mature trees than of young grass
23:21:25 <supermop> Eddi|zuHause: well in alpine areas you may get open vegetated meadows above the treeline
23:22:12 <Eddi|zuHause> supermop: those are tiny details that you can probably ignore at this stage of development
23:22:13 <supermop> but yeah many mountains will have sparse or no herbaceous vegetation near the peaks
23:23:18 <Wolf01> Uh, CircularTileSearch is non clamped on map O_o
23:23:56 <Wolf01> Wait... I used IsValidTile
23:24:15 <Wolf01> Why does it crash with tile > MapSize?
23:24:27 <supermop> Eddi|zuHause: if there is a sparse grass tile, why not use that everywhere, and then have patches of more grassy grass grow to form prairies or meadows
23:25:23 <Eddi|zuHause> Wolf01: because it IsValidTile does not check for map dimensions, only for VOID tiles at the map edge
23:25:56 <supermop> bare rock may be better though - if a steep mountain supports no trees, it is unlikely to support much soil for grass
23:25:59 <Wolf01> No, it checks for map dimmension -> return tile < MapSize() && !IsTileType(tile, MP_VOID);
23:26:41 <Eddi|zuHause> Wolf01: hm, then i don't know
23:27:19 <Eddi|zuHause> the circular search should also try to avoid going over the edge
23:29:38 <Wolf01> I would like to know the stack...
23:30:03 <Eddi|zuHause> use the debugger?
23:30:30 <Wolf01> I'm using the debugger
23:30:47 <Eddi|zuHause> the debugger should show you the stack
23:32:30 <Wolf01> GetRandomTreeType which calls the TileHeight
23:33:18 <Wolf01> I think the CircularTileSearch modifies the tile
23:42:39 <Wolf01> Shouldn't the CircularTileSearch make a copy of tile?
23:42:54 <Eddi|zuHause> why do you pass &tile in there?
23:42:56 <Wolf01> It reuses the same variable to store the new tile
23:43:08 <Wolf01> It's the starting tile
23:44:05 <Eddi|zuHause> yeah, you need to make the copy
23:44:52 <Eddi|zuHause> Tile t = tile; and then pass &t
23:44:54 <Wolf01> Ok, I did now, but why *I* need to make the copy, shouldn't be the function?
23:45:05 <Eddi|zuHause> that would be inefficient
23:45:46 <Wolf01> Also, user_data is not changed back
23:46:02 <Wolf01> Should I change it back like the cast I did before?
23:46:02 <Eddi|zuHause> * @param tile to start the search from. Upon completion, it will return the tile matching the search.
23:46:30 <Wolf01> Ok, so I could just return the check
23:47:05 <Eddi|zuHause> pro tip: read the documentation of the function you're trying to use :p
23:47:54 <Eddi|zuHause> (also, you need to perform a "is valid tile" check on that result, in case no tree was found)
23:47:57 <Wolf01> Eh, intellisense didn't return anything, so I assumed there was none, usually I read that
23:48:30 <Eddi|zuHause> it's on the definition of the function in map.cpp, not on the declaration in map_func.h
23:51:07 <Wolf01> Mmmm, I expected more patches of similar trees, but there's already an improvement
23:55:35 <Samu> if ((GetLockPart(tile) == LOCK_PART_MIDDLE || GetLockPart(tile == LOCK_PART_UPPER) && GetTileMaxZ(tile) + 1) || GetLockPart(tile) == LOCK_PART_LOWER && GetTileMaxZ(tile) + 2 > z_start) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
23:55:56 <Samu> big line, hopefully it does what i want
23:57:49 <Samu> if (IsLock(tile) && ((GetLockPart(tile) == LOCK_PART_MIDDLE || GetLockPart(tile == LOCK_PART_UPPER) && GetTileMaxZ(tile) + 1) || GetLockPart(tile) == LOCK_PART_LOWER && GetTileMaxZ(tile) + 2 > z_start)) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
23:59:52 *** Supercheese has joined #openttd
continue to next day ⏵