[DiscordArchive] What does WorldModel.cpp 41 do ?
[DiscordArchive] What does WorldModel.cpp 41 do ?
Archived author: jackpoz • Posted: 2024-06-24T16:59:50.073000+00:00
Original source
What does WorldModel.cpp 41 do ?
Archived author: stoneharry • Posted: 2024-06-24T17:14:12.424000+00:00
Original source
Yeah, conditional breakpoints on a live environment would be a brutal last resort. I would need to be available for next time it crashes, and I might not be there. Also it will hang the server for all players until I finish debugging. It's not easy to reproduce, it's pretty random but seems to consistently occur on the same map.
https://i.imgur.com/uBXuSjW.png
```c++
bool IntersectTriangle(MeshTriangle const& tri, std::vector<Vector3>::const_iterator points, G3D::Ray const& ray, float& distance)
{
static const float EPS = 1e-5f;
// See RTR2 ch. 13.7 for the algorithm.
const Vector3 e1 = points[tri.idx1] - points[tri.idx0];
const Vector3 e2 = points[tri.idx2] - points[tri.idx0]; // boom!
```https://imgur.com/uBXuSjW
Archived author: jackpoz • Posted: 2024-06-24T17:14:55.106000+00:00
Original source
I thought it was on your dev machine, not prod
Archived author: stoneharry • Posted: 2024-06-24T17:15:10.259000+00:00
Original source
Yeah, unable to reproduce on dev.
Archived author: jackpoz • Posted: 2024-06-24T17:15:30.252000+00:00
Original source
Well, just add a bounds check there
Archived author: jackpoz • Posted: 2024-06-24T17:15:48.227000+00:00
Original source
And log a lot of stuff when that is out of bounds
Archived author: jackpoz • Posted: 2024-06-24T17:18:51.501000+00:00
Original source
tri.idx0 or tri.idx2 are outside of points array bounds