IRC logs for #openttd.dev on OFTC at 2012-09-21
(this day is the first day of recording for this channel)
15:35:38 *** DorpsGek has joined #openttd.dev
15:35:52 <DorpsGek> Yexo: help [<plugin>] [<command>]
15:35:52 <Webster> Yexo: (help [<plugin>] [<command>]) -- This command gives a useful description of what <command> does. <plugin> is only necessary if the command is in more than one plugin.
15:36:20 <TrueBrain> wow @ people on chanlist ..
15:36:32 <DorpsGek> TrueBrain: Error: I need to be opped to op someone.
15:36:39 <TrueBrain> DorpsGek, you can op yourself, dont be silly
15:36:43 *** ChanServ sets mode: +o TrueBrain
15:36:55 *** TrueBrain sets mode: +o DorpsGek
15:37:03 <planetmaker> btw, I made orudge, rubi, truebrain masters of the channel, all others op
15:37:04 *** DorpsGek sets mode: -o TrueBrain
15:37:13 <Yexo> how are we going to keep a list of who has voice here? Do we have an easy way to use chanserv for that?
15:37:25 <TrueBrain> ChanServ can do that, yes
15:37:33 <TrueBrain> it has settings for it
15:37:38 <planetmaker> yexo /cs access #openttd.dev list
15:38:10 <planetmaker> I added three obvious voices ;-)
15:38:47 <TrueBrain> did you enable auto-voice planetmaker?
15:39:00 <planetmaker> at least not conciously
15:39:24 <planetmaker> I also didn't yet set to mute
15:39:29 *** TrueBrain has left #openttd.dev
15:39:30 *** TrueBrain has joined #openttd.dev
15:39:30 *** ChanServ sets mode: +v TrueBrain
15:39:53 *** Yexo has joined #openttd.dev
15:39:53 *** ChanServ sets mode: +v Yexo
15:40:11 <TrueBrain> we can also enable auto-op, but I dont like being op
15:40:21 <planetmaker> you might need that to talk here
15:40:26 <planetmaker> so here it's a good idea
15:40:33 *** DorpsGek sets mode: +o TrueBrain
15:40:35 <planetmaker> the idea is to only allow voice+op to speak
15:41:13 <planetmaker> unless you want to enable logging in dorpsgek, we should keep it
15:41:21 <TrueBrain> DorpsGek always logs
15:41:31 *** DorpsGek sets mode: +v Alberth
15:41:35 *** DorpsGek sets mode: +v Terkhen
15:41:37 *** DorpsGek sets mode: +v orudge
15:41:51 <TrueBrain> @topic OpenTTD Dev Talk | Get your patch reviewed here
15:41:51 <DorpsGek> TrueBrain: topic [<channel>]
15:41:56 <TrueBrain> @topic #openttd.dev OpenTTD Dev Talk | Get your patch reviewed here
15:41:56 <DorpsGek> TrueBrain: topic [<channel>]
15:42:03 *** DorpsGek sets mode: -o TrueBrain
15:42:12 <TrueBrain> Webster is annoying, it also replies to @ commands
15:42:12 <planetmaker> @voice planetmaker
15:42:16 <TrueBrain> for no good reason :(
15:42:43 <planetmaker> it's the coop bot. Make logging here a public URL and we don't need it
15:42:48 <DorpsGek> planetmaker: I don't recognize you.
15:42:48 <TrueBrain> try @whoami planetmaker :D
15:43:12 <TrueBrain> and I dont mind having a bot specially for logging ..
15:43:21 <DorpsGek> planetmaker: planetmaker
15:43:29 <TrueBrain> its just annoying it also replies to commands that are invalid :D
15:44:00 <TrueBrain> I might one day fix up DorpsGek to bemore useful :)
15:44:18 <TrueBrain> atm it logs ALL channels he is in, including certain private channels ... publishing those logs might not be the best idea out there :D
15:44:45 <DorpsGek> planetmaker: planetmaker
15:45:01 <planetmaker> stupid, stupid :-)
15:45:05 <TrueBrain> I am guessing you have no permissions in this channel :D:D
15:45:12 <TrueBrain> how do I add those ....
15:45:17 <TrueBrain> horrible, supybot for configuration
15:45:25 <planetmaker> @makeop planetmaker openttd.dev or so
15:45:28 *** KenjiE20 has joined #openttd.dev
15:45:36 <TrueBrain> @makeop planetmaker #openttd.dev
15:45:41 <TrueBrain> Webster replies to me :D
15:45:45 <planetmaker> @channel capability add #openttd.dev planetmaker op
15:45:54 <TrueBrain> @channel capability add #openttd.dev planetmaker op
15:45:54 <DorpsGek> TrueBrain: The operation succeeded.
15:45:59 <TrueBrain> not even remotely like what you suggested :D
15:46:10 <TrueBrain> @channel capability add #openttd.dev glx op
15:46:10 <DorpsGek> TrueBrain: The operation succeeded.
15:46:15 <planetmaker> it shares the channel name and user name, though ;-)
15:46:15 <TrueBrain> @channel capability add #openttd.dev Terkhen op
15:46:15 <DorpsGek> TrueBrain: The operation succeeded.
15:46:26 <TrueBrain> @channel capability add #openttd.dev Yexo op
15:46:26 <DorpsGek> TrueBrain: The operation succeeded.
15:46:31 <TrueBrain> @channel capability add #openttd.dev orudge op
15:46:31 <DorpsGek> TrueBrain: Error: I can't find orudge in my user database. If you didn't give a user name, then I might not know what your user is, and you'll need to identify before this command might work.
15:46:37 <TrueBrain> @channel capability add #openttd.dev Rubidium op
15:46:37 <DorpsGek> TrueBrain: The operation succeeded.
15:46:48 <TrueBrain> @channel capability add #openttd.dev Alberth op
15:46:48 <DorpsGek> TrueBrain: Error: I can't find Alberth in my user database. If you didn't give a user name, then I might not know what your user is, and you'll need to identify before this command might work.
15:47:01 <TrueBrain> meh; more will follow when needed
15:47:11 <DorpsGek> Terkhen: I don't recognize you.
15:47:17 <TrueBrain> try opping webster now planetmaker?
15:48:51 *** DorpsGek sets mode: +o TrueBrain
15:48:55 *** DorpsGek sets mode: +o Webster
15:49:05 <Webster> I can be @mute'd :p /KenjiE20
15:49:21 *** TrueBrain changes topic to "OpenTTD Development Channel | Earn your voice, write patches"
15:49:24 *** DorpsGek sets mode: -o TrueBrain
15:49:51 <TrueBrain> lets leave Webster deopped :P
15:50:51 <planetmaker> nah, just trying to tell him to just ignore commands given here
15:52:16 <TrueBrain> I like it if logger bots hide in the crowd, unsuspecting ..... ;)
15:52:38 <TrueBrain> we have at least 3 in #openttd :D
15:52:50 <TrueBrain> (know I am only kidding, I really dont care either way :))
15:53:29 <planetmaker> webster is now silent
15:53:55 <TrueBrain> @makeop planetmaker #openttd.dev
15:54:01 <TrueBrain> yeah, it didnt talk back to me
15:54:13 <planetmaker> it won't talk to anyone here now ;-)
15:54:26 *** DorpsGek sets mode: -o Webster
15:54:40 <TrueBrain> put the logger URL in topic?
15:54:46 <TrueBrain> topic needs work anyway :D
15:56:20 *** DorpsGek sets mode: +v KenjiE20
15:56:35 <planetmaker> let him allow to talk when here's the bot he maintains :D
15:57:08 <KenjiE20> only here for set up anyway :)
15:57:21 <TrueBrain> its fine either way really :)
15:57:30 <TrueBrain> you are not a 10 year old child, so you will do fine :)
15:57:42 <KenjiE20> I have enough channels open already, my client hits the shell limit
15:57:54 <TrueBrain> less chatting, more working :D
15:59:30 <planetmaker> but I can only offer bread and some chease
15:59:39 <TrueBrain> hmm, that sounds like a very good idea
16:01:14 <Terkhen> I can offer a nutella sandwich :P
16:01:34 <Terkhen> heh, we are going offtopic already
16:01:46 <Terkhen> it took us less than an hour
16:02:53 <KenjiE20> Rules of IRC, rooms are never on topic
16:15:19 *** DorpsGek sets mode: -v TrueBrain
16:41:25 *** snobbo has joined #openttd.dev
17:34:54 *** snobby has joined #openttd.dev
17:44:20 <Yexo> does anyone want to make a forum post to announce this channel?
17:47:31 <planetmaker> ah... so we skip your posting for the time?
18:30:13 *** Zuu has joined #openttd.dev
18:30:35 <Alberth> our new home for patch reviews :)
18:31:00 <Alberth> public channel, but not everybody has voice
18:31:26 <planetmaker> currently only eddi, andy and hirundo have except us
18:31:27 <Alberth> anyways, + (paused ? COLOUR_YELLOW : COLOUR_GREY); <-- needs an extra TAB
18:31:47 <Alberth> andy writes patches? :)
18:31:59 <Yexo> no, but does have sensible ideas from time to time
18:32:45 *** DorpsGek sets mode: -o planetmaker
18:33:04 <Terkhen> did you send them invites? :)
18:33:07 *** DorpsGek sets mode: +v planetmaker
18:33:26 *** Eddi|zuHause has joined #openttd.dev
18:33:45 <Alberth> Zuu: continued lines are normally indented with 2 TABs to make them different from normal indented code
18:33:45 <planetmaker> @voice Eddi|zuHause
18:33:45 *** DorpsGek sets mode: +v Eddi|zuHause
18:34:01 <DorpsGek> Terkhen: I don't recognize you.
18:34:45 <Terkhen> planetmaker: I guess that Hirundo and andythenorth are not around :P
18:34:57 <planetmaker> yes. I invited hirundo, though
18:36:40 <Alberth> Zuu: in src/script/script_instance.cpp, 2nd hunk + if (this->is_paused) return; <--can be combined with the line above
18:36:42 <Yexo> Zuu: in script_instance.cpp second chunk, shouldn't the "if (this->is_paused)" check be after the "crashed during saving" check?
18:37:06 <Eddi|zuHause> i'll probably forget to put this into the autojoin list... ;)
18:37:14 * Zuu got caught in a phone call.
18:37:21 <Zuu> Let me take things in order.. :-)
18:37:58 <Alberth> + /* Set the paused flag. */ <-- 3rd hunk, this is useless, as it says exactly the same thing as the code at the line below
18:38:10 <Yexo> also you've modified the comments for IsSleeping() but not the code, is that correct?
18:38:34 <Alberth> Zuu: that's usually the best order, we can produce comments way faster than you can process them anyway :)
18:40:20 <Zuu> <Alberth> anyways, + (paused ? COLOUR_YELLOW : COLOUR_GREY); <-- needs an extra TAB <--- Corrected (locally)
18:42:35 <Alberth> The chance in src/misc_cmd.cpp looks fishy at first sight, I'd expect it to be moved but it disappears instead
18:44:21 <Zuu> <Yexo> Zuu: in script_instance.cpp second chunk, shouldn't the "if (this->is_paused)" check be after the "crashed during saving" check? <--- Yes, that sounds better than the current code.
18:46:16 <Zuu> <Alberth> + /* Set the paused flag. */ <-- 3rd hunk, this is useless, as it says exactly the same thing as the code at the line below <--- that is probably my habit that if you have a heading above and you have code that is not part of that section, you show that by adding a comment that start a new section.
18:47:28 <Alberth> I usually use an empty line, or if it is a big section, a line of comment with the overal goal of that section
18:47:50 *** DorpsGek sets mode: +v TrueBrain
18:48:30 <Alberth> but one line is hardly a section :)
18:48:34 <TrueBrain> @channel capability add #openttd.dev Zuu op
18:48:34 <DorpsGek> TrueBrain: Error: I can't find Zuu in my user database. If you didn't give a user name, then I might not know what your user is, and you'll need to identify before this command might work.
18:48:37 <Zuu> But I will remove the comment as it is indeed saying pretty much what the line below does.
19:00:21 <Zuu> <Yexo> also you've modified the comments for IsSleeping() but not the code, is that correct? <--- If you enter a new tick when the AI/GS is paused, it will never be un-suspended and thus in that suspended-case the check is enough. If you are in a tick when a AI/GS get paused, then in case of eg. a Valuator, there may be a delay from when is_paused is set to true and the AI/GS beeing suspended. Only when the AI/GS have been suspended it is sle
19:00:21 <Zuu> eping even if it had its is_paused-flag toggled before.
19:01:01 <Zuu> Can you think of any case when is_paused is true, and the AI is not suspended, but should still be regarded as sleeping?
19:03:48 <Zuu> <Alberth> The chance in src/misc_cmd.cpp looks fishy at first sight, I'd expect it to be moved but it disappears instead <--- It is indeed a mistake there. I think in some idea that I had in which direction to take the changes it made sense. (eg. if you decide to completely decouple script pausing from game pausing as that code invalidate the debug window when the game is unpaused)
19:04:19 <Zuu> However, in the end I ended up with an approach where the first paused script pauses the game and the last unpaused script resumes the game, and thus that line is still needed.
19:13:32 *** andythenorth has joined #openttd.dev
19:13:32 *** ChanServ sets mode: +v andythenorth
19:14:10 <Yexo> Zuu: can you upload a new diff if you fixed the above mentioned issues?
19:17:32 <Yexo> at least the original TTO savegame
19:17:36 <Zuu> However, I need to review the window invalidate code to make unpausing via toolbar disable the continue button propperly.
19:17:58 <Yexo> the more recent savegame still crashes
19:30:09 <Yexo> if (_networking && !_network_server) return; <- are those checks really required in ai_core.cpp?
19:30:57 <Yexo> first hunk in ai_gui.cpp: + */, it should be on the line before
19:31:32 *** FLHerne has joined #openttd.dev
19:31:57 *** kermit has joined #openttd.dev
19:32:02 <Zuu> <Yexo> if (_networking && !_network_server) return; <- are those checks really required in ai_core.cpp? <--- That check could be changed to only return when a dedicated server runs to allow using eg. AIController::Break() on MP servers with a GUI, but currently there is no way for a non-GUI MP server to resume scripts.
19:33:35 <Yexo> I meant it more like: are those ever called for clients in multiplayer?
19:35:05 <Zuu> The network check for IsPaused is probably useless however.
19:35:53 <Zuu> Unpause too, but the purpose there is as said above that for dedicated servers there is no interface to unpause scritps that have been paused.
19:36:28 <Zuu> I guess the chance is rather low that a non-script developer end up pausing a script on a dedicated server, but why not protect from it in code?
19:38:08 <Yexo> those checks don't check for dedicated/non-dedicated server
19:38:25 <Zuu> yes, I will change it to if (_networking && _network_dedicated) return;
19:38:46 <Zuu> The current code is more strict than the new propsal.
19:40:25 <Yexo> if (_network_dedicated) return; <- that should be enough
19:41:18 <Zuu> Should I perhaps comment that code to tell that the purpose is not that Pause is unsafe in MP, but the fact that there is no way the script can be unpaused by the server owner?
19:41:39 <Yexo> yes, that would be nice :)
19:41:48 <Yexo> I have no further comments
19:42:21 *** Frankr has joined #openttd.dev
19:42:30 *** Frankr has left #openttd.dev
19:44:42 <Zuu> I've added a such comment now and:
19:44:43 <Zuu> <Yexo> first hunk in ai_gui.cpp: + */, it should be on the line before <--- fixed
19:44:54 <Zuu> So thanks for the review :-)
19:50:44 <Yexo> also added another check for half-tile slopes since without that it crashes in the viewport code
19:58:31 <TrueBrain> what is the benefit?
19:58:36 <TrueBrain> except for yet another macro?
19:58:43 <Yexo> the macro already exists
19:59:02 <TrueBrain> and it is used in the same way?
19:59:21 <Yexo> static const uint HALF_TILE_SIZE = TILE_SIZE / 2; ///< Half of tile size, to get centre of a tile.
19:59:32 <TrueBrain> so then the patch seems like a nobrainer to me :D
20:00:19 <Yexo> (v->x_pos & ~TILE_UNIT_MASK) + HALF_TILE_SIZE; <- it's used like that, to go from any position on a tile to the center, but it's only used in 5 places
20:01:10 <Alberth> I prefer not having that patch tbh
20:07:08 <TrueBrain> then remove those 5 cases too? :)
20:09:19 *** andythenorth has left #openttd.dev
20:12:39 <Alberth> yeah, yeah, rebuild everything, stupid Makefile :p
20:13:34 <TrueBrain> pfff .. everyone is a critic :D
20:18:03 <Yexo> ScriptController::Break shouldn't use EnforcePrecondition
20:18:21 <Yexo> EnforcePrecondition should only be used by functions that do some DoCommand
20:18:33 <Zuu> Just plain if-statements?
20:20:24 <Yexo> It shouldn't be listed as @pre in the documentation either. It's not an error to call Break() when one of these is not true, it will just be ignored
20:20:56 <Yexo> + /* Inform script developer that his script have been paused and <- s/have/has/
20:21:07 <Yexo> + * need manual action to continue. */ <- s/need/needs/
20:21:19 <Zuu> So, those limitations should just be mentioned in the description instead of using @pre?
20:21:57 <Yexo> you could do "@note if tools tools enabled or multiplayer this function is a no-op"
20:22:06 <Yexo> + * other users, nothing will happen when you call this function. To ressume <- resume
20:23:27 <Alberth> @pre is a hard pre-condition, live with it, or die, generally :)
20:24:47 <Zuu> well, if you don't fullfill these two points the Break function is useless.
20:24:50 <Yexo> Alberth: could you please close FS#5200 (the HALF_TILE_SIZE one) with an explanation of why you don't like it?
20:25:10 <Alberth> sure, I was working a reverse patch :)
20:25:21 <Yexo> ah, even better, close it when that's done :)
20:28:21 <Zuu> * @note gui.ai_developer_tools setting must be enabled or the break is
20:28:22 <Zuu> * ignored. Additionally breaks are ignored by dedicated servers.
20:28:52 <Yexo> I'd leave out the bit about dedicated servers. Is that interesting information for script writers?
20:33:53 <Zuu> Yexo: re r24538: Does some compiler complain because initalization is not done in the same order as the variables are declared?
20:34:21 <Yexo> g++ (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
20:34:34 <Alberth> yes, the C++ standard afaik :)
20:35:16 <Yexo> initialization is always done in the order declared in the .h file, the order in the cpp file is not important
20:35:37 <Yexo> the compiler warns because those initializations can depend on eachother in which case the order is important
20:35:52 <Yexo> the easiest way around that is to make sure the order is the same in the .h and .cpp file
20:36:33 <Zuu> I usually only care about initializing order in .cpp and order things in .h in logical groups that may and may not match with loading order.
20:51:18 <Yexo> Zuu: the #ifdef ENABLE_NETWORK was not needed
20:51:58 <Yexo> network.h defines _networking, _network_server, _network_available, _network_dedicated and _is_network_server as 0 if ENABLE_NETWORK is not defined
20:52:52 <Zuu> ok, I just commited it before your comment, but I could fix it still. :-)
20:53:15 <Yexo> I only noticed when I reviewed your commit, not before, sorry about that
20:59:50 *** Alberth has left #openttd.dev
21:10:58 *** snobbo has joined #openttd.dev
21:19:52 *** snobby has joined #openttd.dev
21:32:43 *** Supercheese has joined #openttd.dev
23:45:08 *** michi_cc has joined #openttd.dev
23:45:09 *** ChanServ sets mode: +v michi_cc
continue to next day ⏵