fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Crash when ai is ordered to fly waypoints created by scripting, since Nightly 23.3.0-20231103

Open Admiral-MS opened this issue 1 year ago • 2 comments

Waypoints created with the scripting function mn.createWaypoint() lead to a game crash when the Ai is ordered to fly the associated waypoint path. A simple test script and mission are attached, the game crashes a few seconds into the mission. The bug appears in Nightly 23.3.0-20231103 and still exists in the current 24.2.0-RC4, any build up to 20231102 works fine.

Debug error message: Assert: "!aip->wp_list->get_waypoints().empty()" File: aicode.cpp Line: 4908 waypoint_testcase_crash_from_Nightly_20231103.zip

Admiral-MS avatar Sep 14 '24 12:09 Admiral-MS

This is an invalid pointer access due to a vector reallocation. The code will need to use an index rather than a pointer. It's the same problem as #5785, just with a different field in a different struct.

Goober5000 avatar Sep 14 '24 19:09 Goober5000

The fix is nearly ready to go, but will not be included in 24.2 due to its widespread scope.

Goober5000 avatar Sep 17 '24 18:09 Goober5000