IRC logs for #openttd.dev on OFTC at 2013-08-25
⏴ go to previous day
01:18:22 *** Supercheese has joined #openttd.dev
03:48:06 *** Supercheese has joined #openttd.dev
07:51:37 *** Alberth has joined #openttd.dev
07:51:37 *** ChanServ sets mode: +v Alberth
08:04:01 *** LordAro has joined #openttd.dev
08:04:01 *** ChanServ sets mode: +v LordAro
08:46:45 *** Zuu has joined #openttd.dev
08:47:14 *** Zuu is now known as Guest4437
08:50:28 *** Guest4437 is now known as Zuu
10:46:06 *** frosch123 has joined #openttd.dev
10:46:06 *** ChanServ sets mode: +v frosch123
11:00:33 *** ntoskrnl has joined #openttd.dev
11:09:31 *** ntoskrnl11 has joined #openttd.dev
11:13:13 <frosch123> +void ScrollToLocation(const NewsItem *ni, bool open_loc) <- +static
11:15:10 <frosch123> what about vehicle news?
11:15:18 <frosch123> shouldn't it rather open the vehicle gui?
11:16:19 <frosch123> well, all wrong i guess :p
11:16:31 <frosch123> in the news item you can click on the vehicle directly
11:16:56 <frosch123> we should drop all this ctrl crap somewhen and add proper location buttons everywhere :)
11:17:11 <frosch123> then we can also distinguish between vehicle gui, scrollto and new viewport :p
11:19:46 <LordAro> now look into FS#5722 :D
11:24:39 <Alberth> sounds like a nice todo goal
11:27:09 *** ntoskrnl has joined #openttd.dev
12:19:48 *** ntoskrnl11 has joined #openttd.dev
16:52:33 *** Supercheese has joined #openttd.dev
19:35:55 <Zuu> (yes, I should have had split the patch)
19:36:26 <Zuu> The patch is untested as I don't have a compiling environment at the moment.
19:37:05 <Zuu> I have made the command available for both AIs and GSes.
19:37:34 <frosch123> should SetName really be available to ais?
19:38:01 <frosch123> we forbid it in multiplayer for regular players, so noone can mess them up
19:38:12 <frosch123> i would think people would be annoyed about ais renaming towns
19:39:09 <planetmaker> AIs renaming towns? No. GS: yes
19:40:55 <frosch123> + static bool *SetName(TownID town_id, Text text); <- returning "bool*"
19:41:14 <Zuu> Hmm right, SetName shouldn't be available to AIs.
19:41:15 <frosch123> well, is correct in .cpp
19:41:58 <frosch123> + return ScriptObject::DoCommand(tile, size & (city ? 1 << 2 : 0) & layout << 3, townnameparts, CMD_FOUND_TOWN, encoded_text); <- confused | and &
19:42:15 <Zuu> frosch123 + static bool *SetName(TownID town_id, Text text); <- returning "bool*" <---- silly mistake
19:42:35 <frosch123> do townnames allow encoded texts?
19:42:37 <Zuu> frosch123 + static bool *SetName(TownID town_id, Text text); <- returning "bool*" <--- yes you are right
19:42:56 <frosch123> iirc rb recently disallowed that for signs, because it fails
19:43:45 <Zuu> I looked at ScriptTown::SetText for comparison.
19:43:59 <Zuu> But I also remember that rb did a change regarding encoded/decoded text.
19:44:02 <frosch123> i think that one allows more
19:44:11 <frosch123> rather look at ScriptSign::SetName
19:44:16 <frosch123> it does some length check
19:45:50 <frosch123> + const char *encoded_text = text != NULL ? text->GetEncodedText() : 0; <- NULL instead of 0, but maybe just put it into the else part of the if below
19:46:35 <frosch123> compared to ScriptSign::SetName it also misses the CCountedPtr
19:46:49 <frosch123> to free the text on return
20:22:13 <Zuu> I have also addressed that when economy.fund_town is 0, funding towns should fail for non-deity.
20:22:51 <Zuu> As a pre condition (before it only failed in the DoCommand)
20:23:16 <frosch123> ai_changelog still lists SetName
20:25:14 <frosch123> Zuu: hmm, i wondered... doesn't GenerateTownName(&townnameparts) always need calling?
20:25:35 <frosch123> i think the town needs a generated name in any case, even if additionally a custom one is supplied
20:26:12 *** Alberth has left #openttd.dev
20:27:22 <Zuu> Hmm, FoundTownCmd don't mention that p2 is unused when a custom name is supplied. So you are possible right.
20:27:51 <frosch123> i guess SetName with NULL would reset to that default name
20:27:59 <frosch123> like the gui has a "default" button
20:29:35 <Zuu> Right, I'll change it so that the town name parts are generated no matter if a custom name is supplied.
20:29:48 <Zuu> And thanks for noticing the AI changelog error.
20:34:18 <frosch123> yeah, asking a compiler about syntax is always good :)
continue to next day ⏵