Last one! Done with the SHARED segment for the forseeable future! 🎉 Sure, not the best C++ code either, but still by far the sanest implementation of this function in any of the 4 games. Completes P0139, funded by [Anonymous].