IRC logs for #opendune on OFTC at 2010-03-22
⏴ go to previous day
11:59:20 *** arik1811 has joined #openDune
13:36:24 *** TinoDidriksen has joined #openDune
15:34:15 <TrueBrain> src/opendune.c: In function 'Main':
15:34:17 <TrueBrain> src/opendune.c:792: warning: format not a string literal and no format arguments
15:35:14 <DorpsGek> SVN: truebrain (r1015) -Fix (r1010): go for safety
15:35:45 <glx> oh you have a stricter gcc
15:35:59 <TrueBrain> it is pretty unsafe ;)
15:36:09 <TrueBrain> if there is a "%s" in the string ...
16:03:48 <TrueBrain> I love reducing 30 lines to a single one: if (House_AreAllied(s->houseID, u->houseID)) continue;
16:08:11 <TrueBrain> the result value of Tile_GetDistance can never be really big, can it?
16:08:24 <TrueBrain> sometimes, I don't understand code ..
16:24:59 <TrueBrain> I think this function is broken ...
16:25:09 <TrueBrain> I think it returns the closest enemy for structures
16:25:12 <TrueBrain> but ... something is weird
16:25:18 <TrueBrain> loc0A is set to a high value
16:25:29 <TrueBrain> loc06 is set to the distance between structure and unit
16:25:57 <TrueBrain> now if loc06 is lower than loc0E (which seems to hold a completely different value, given via the stack)
16:26:01 <TrueBrain> loc06 is set to loc0A
16:31:03 <glx> <TrueBrain> sometimes, I don't understand code .. <-- happens to me too
16:31:54 <TrueBrain> an Ornithopter shoots also at 'friends' btw :)
16:32:25 <glx> I still don't know how to shoot them down
16:32:29 <TrueBrain> but can you verify if my conversion is correct, as 'distance = distanceCurrent' is just stupid
16:33:07 <TrueBrain> if I converted this code correctly, a structure always targets the highest ID when finding for something to attack
16:33:15 <TrueBrain> instead of closest, what it appears to should be doing
16:33:35 <TrueBrain> which is still stupid, as one would expect it uses the priority function we found earlier
16:33:57 <glx> priority function is used for units at least
16:39:40 <glx> hmm you inverted args for Tile_GetDistance()
16:39:48 <glx> shouldn't matter but who knows
16:39:57 <TrueBrain> abs() is used, so it doesn't :)
16:40:05 <TrueBrain> uint16 distance_x = abs(from.s.x - to.s.x);
16:40:06 <TrueBrain> uint16 distance_y = abs(from.s.y - to.s.y);
16:43:35 <TrueBrain> I also find it weird it does >= continue .. so when at the range of the structure, it doesn't target yet ...
16:44:32 <TrueBrain> then of course Tile_GetDistance is one fucked up function to use for it anyway ...
16:44:47 <TrueBrain> and most likely the reason why launchers can fire at turrets without being shot back
16:50:03 <TrueBrain> so it really has this bullshit line: distance = distanceCurrent
16:50:08 <TrueBrain> as 'distance' is trashed afterwards
16:51:28 <TrueBrain> made it an enhancement
16:55:46 <glx> it's like Unit_FindBestTarget(), which originally have a write-only loc12
17:01:23 <DorpsGek> SVN: truebrain (r1016) -Add: C-ified Script_Structure_FindTargetUnit(), and an enhancement which means a turret targets the closest unit instead of the one with the highest index
17:13:23 <glx> sometimes I wonder why they used local variables
17:31:57 <DorpsGek> SVN: glx (r1017) -Add: C-ified Unit_RemoveFog()
17:36:01 <DorpsGek> SVN: glx (r1018) -Fix: MSVC warnings
17:36:17 <glx> (the map.c one is weird ;) )
continue to next day ⏵