Adding new figure to WebGL settings.json causes glitch

Expected Behavior

I can go on settings.json, add a new item to the figures list, see no effects on refresh unless I have code pointing to said figure

Current Behavior

I can go on settings.json, add a new item to the figures list, and refresh to see all models now having glitch scarves spazzing around

Steps to Reproduce

  1. Make sure you have the game pulled up, verify working WebGL renders
  2. Find bin/resources/webgl/scene1/settings.json
  3. Find models.figures, add some valid element to list like this:
                {
                    "figId": "Foo",
                    "filename": "g8female/Kitty Panty/Kitty Panty.obj",
                    "visible": false,
                    "surfaces": [
                        {
                            "visible": true,
                            "surfaceId": "kitty_panty_panty",
                            "matIds": [
                                "kitty_panty_panty"
                            ]
                        }
                    ]
                },
  1. Refresh game
  2. Now your girls either have spazz scarves, or start gaslighting you about their outfits image image

Additional information

  • Release ID: FC version: 0.10.7.1, build: 1181.
  • Commit: 7949a28c
  • Note: Culprit code might be the .initMorphs() method on art/webgl/engine.js, line 889
	initMorphs(modelBuffers, modelData, dir) {
		window.sceneBlocks = {}; // automatically populated during loading of morphs

		let promisedMorphs = [];
		modelBuffers.vertexPositionMorphs = [];
		modelBuffers.vertexIndexMorphs = [];
		for (let f=0; f < modelData.figures.length; f++) {
			modelBuffers.vertexPositionMorphs[f] = [];

Referring across arrays by index like this is generally a bad idea, it should be a dict.

Edited by PooPooDooDooHead