RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
991 stars 175 forks source link

Flexbody 'forsets' typo results in missing mesh #3053

Closed CuriousMike56 closed 1 year ago

CuriousMike56 commented 1 year ago

A select few mods (one example: https://forum.rigsofrods.org/threads/87-yamaha-yfz350-banshee.3781/) have a typo in their flexbodies section, where forset is spelled with an S:

flexbodies
7, 2, 86, 0.5, 0.0, 0.25, 0, 180, 0, BanshBody.mesh
forsets 66-71, 0,5,48,45, 54-57, 60-65,10,13,14,17

This was parsed correctly in previous versions, now in 2022.12+ the flexbody no longer appears.

ohlidalp commented 1 year ago

Jesus Christ, another quirk to the list:

void Parser::ParseDirectiveForset()
{
    Forset def;

    // --------------------------------------------------------------------------------------------
    // BEWARE OF QUIRKS in the following code (they must be preserved for backwards compatibility):
    // - a space between the 'forset' keyword and arguments is optional.
    // - a separator at the end of line will silently add '0' to the node list.
    // --------------------------------------------------------------------------------------------

Broken here: https://github.com/RigsOfRods/rigs-of-rods/commit/af179f26c09e10f91c90429cf3fbd7265d34cf21#diff-b84044f869d47736837d3cffd944ce1d6b87bbbc1932abd2f6f8323c6b4e5e57

We have 2 options: A) Add a new entry to the quirk list: - garbage characters anywhere in the line will silently add 0 to the node list. and hack the keyword-recognition regex for this single case. B) Just fix the damn mods (my prefered solution)

ohlidalp commented 1 year ago

@CuriousMike56 Sorry about the outburst above and thanks for filling the report. The forset is really an odd feature which brought me a lot of grief. I implemented option A above, with some extra fixes.