You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugfix(projectile): Fix out-of-bounds access in DumbProjectile which causes mismatch with very high speed weapons at small hit distances (TheSuperHackers#2087)
//long, blurry projectile graphics which look badly oriented on step 0 of the flight path
649
653
// so lets orient it the same as if it were on frame 1!
650
654
{
651
-
Coord3D prevPos = m_flightPath[0];
652
-
Coord3D curPos = m_flightPath[1];
655
+
// TheSuperHackers @bugfix Caball009 10/01/2026 Check vector size before accessing the second element to prevent out of bounds access.
656
+
// The non-deterministic behavior for retail clients cannot be fixed, so this will remain a source of potential mismatches in retail compatibility mode.
657
+
// Use the flight path start and end coordinates if needed, so that the behavior is deterministic for patched clients.
658
+
Coord3D prevPos;
659
+
Coord3D curPos;
660
+
661
+
if (m_flightPath.size() >= 2)
662
+
{
663
+
prevPos = m_flightPath[0];
664
+
curPos = m_flightPath[1];
665
+
}
666
+
else
667
+
{
668
+
#if RETAIL_COMPATIBLE_CRC
669
+
DEBUG_CRASH(("A mismatch is likely to happen if this code path is used in a match with unpatched clients."
670
+
" Vector is expected to contain two or more elements; check the weapon speed value."));
0 commit comments