Asterix Gaming Guild Logo GeneralXXLXXL 2XXL 3XXXLOlympic GamesXXL EditorToolsOff-TopicXXL RomasteredXXL 2 RemasteredOther GamesModsCaesar's ChallengeUnfair XXLPatchesFan ArtPersonal ArtSpeedrunningMediaRandomizerBETA RomeHSKALPresence AdrienPresence SPQRSupport Bot Helpdesk

#hskal

pegperegogaucho
Hmm, weird, I never edited the value and it still seemed to work just fine :FrogThinking:
hesopesomeso
``` frame_a2 = a2->data.data.data.data.rw_frame; frame_a1 = a1->data.data.data.data.rw_frame; rsum = a1->data.data.radius + a2->data.data.radius; xdiff = frame_a1->ltm.pos.x - frame_a2->ltm.pos.x; if (xdiff) > (double)rsum ) return 0; zdiff = frame_a1->ltm.pos.z - frame_a2->ltm.pos.z; if ( zdiff > (double)rsum ) return 0; ydiff = frame_a1->ltm.pos.y - frame_a2->ltm.pos.y; if (ydiff > (double)rsum ) return 0; ... ``` This is a kobb-kobb collision detection check, and as you can see they first check the radii for a quick check.
pegperegogaucho
Makes sense, although might be superfluous for shapes like AABB or spheres themselves
pegperegogaucho
Maybe for my stuff the radius was always big enough...
hesopesomeso
Spheres actually use that value, don't they?
pegperegogaucho
:Obelul: Okay, you got me
hesopesomeso
:KEKW: And this?
pegperegogaucho
That is probably for the cannon button, if it would be present
pegperegogaucho
I'm sure that their editor automatically made it regardless of machine type
pegperegogaucho
I believe bombs can also trigger that shape and make the machine extend the rollers despite it not being the other type of machine. This happened a couple of times in my UXXL playthroughs :PogelixOkay:
hesopesomeso
:Obelul: Lol
hesopesomeso
Another one of those...
hesopesomeso
Either way, I got something going finally....
pegperegogaucho
Yes that is a fiendish bug, you have to make sure to increment the counter each iteration
pegperegogaucho
I have also fallen victim to it many times with range-based for loops. I believe it might be smarter to just use normal for loops since this issue is very dangerous
pegperegogaucho
Maybe another solution would be to make a "enumerate" function like in python, so you can use structured bindings for both the index and the element and always have it match, but I haven't tried that out yet, might cause the compiler to emit less efficient code for no reason
hesopesomeso
Yeah... It's just so convenient though- I don't have to type 10 more characters :Obelul: I'll have to make sure I always put it at the end of the for scope...
hesopesomeso
Why not just make C++ into Python altogether? :KEKW:
adrientd
There is a `std::ranges::views::enumerate` function doing that, but only since C++23...
hesopesomeso
```c++ for (auto [i, action] : std::views::enumerate(std::ranges::ref_view(actions))) { if (action.is_active()) { action.process(action_values[i], time); } } ``` I'd have to do something like this.