12:25 < rand> matricks: i rewrote IntersectLine in a closer way to what you expected by 32x faster (i guess), I still use some hack for the PosBeforeCollision used by laser 12:25 < rand> > https://github.com/nheir/teeworlds/commit/1bd4def5ed1fe212c8faaaeac32fcd52a21978fe 12:27 < rand> it's more efficient than the implementation using segments 12:55 <@matricks> please name your variables :D 12:56 < rand> okok 12:57 <@matricks> does... does that one work? 12:58 < rand> yes, at least with basic tests with one player 12:58 <@matricks> oh.. there was a continue in there that I missed 12:59 <@matricks> remove that continue 12:59 <@matricks> just do if() {} else {} for readability 13:01 <@matricks> rand: line 122-135 is unnessesary and can be replaced with a "break;" 13:02 <@matricks> rand: this is bascilly a variation of bresenham 13:02 <@heinrich5991> bresenham? 13:02 <@matricks> https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm 13:04 < rand> yep 13:05 <@matricks> rand: the way you wrote it now is how I intended to write it first, but I was lazy and just wanted something that works :) 13:05 < rand> :D 13:05 <@matricks> I might have done it slightly different, but the principle is the same 13:06 <@matricks> but clean it up a bit and it will be a nice peice of code 13:06 < rand> ok, I did understand this when you said “it can be 32x faster” :) 13:06 <@matricks> yeah, kinda the hint in the name :) 13:06 <@matricks> and how I could be so precise when I said 32x ;) 13:07 <@matricks> it's gonna be smaller and faster then the stuff you made 13:08 <@matricks> rand: loads of variables there shuld be const as well 13:09 <@heinrich5991> rust! everything is const! 13:09 <@heinrich5991> (except for a few weird corner cases, like mutable in c++) 13:10 < rand> matricks: which variables? (for example) 13:10 <@matricks> well, most of em :D 13:10 <@heinrich5991> put a const in front of everything and see what cna't be const 13:10 <@heinrich5991> then remove those :) 13:10 < rand> ok 13:11 < rand> since I didn't see that much const variables in the code… ^^ 13:11 <@matricks> i_a, j_a, i_b, j_b, idx, idy, di, dj, ci, cj 13:11 < rand> and cst ^^ 13:11 <@matricks> and as I said, name them :D 13:12 < rand> Tile0X, Tile0Y… how does it sound ? 13:12 <@matricks> for which variables? :D 13:12 < rand> i_a and j_a 13:12 <@matricks> yeah 13:13 < rand> ci and cj will get weird names 13:14 < rand> perhaps rewrite to reduce the amount of variables using something like error like in bresenham