Issue Type: Other
Impact: High
Frequency: Very Rare
Date First Experienced: 2021-04-19 12:04:00 (-03:00)
Date Last Experienced:
Reproduction Steps:
- Open an empty baseplate in Roblox Studio 0.474.0.420553 with no user plugins enabled
- Try to insert any rig from the Rig Builder plugin
- Regardless of the rig selection, it will always load the blocky R15/R6 rigs.
Expected Behavior:
I expected the Rig Builder to load the correct rig types when I click the buttons, such as the Rthro models when I click the Rthro buttons.
Actual Behavior:
The Rig Editor always loads the blocky rigs. If the R15 tab is selected, it loads the R15 blocky rig. If the R6 tab is selected, it loads the R6 blocky rig.
Video demonstration of the issue:
Workaround:
The most immediate workaround is forking the plugin, modifying the broken code, removing protected calls and loading it as an user plugin (highly impractical). Namely, the offending lines are lines 75-99 in the RigBuilder script inside the plugin model:
if mode == "R6" then
if name == RigBuilderLocalized and localization:getText("RigOption", "BlockRig") or "Block Rig" then
rig = rigModule.CreateR6Rig()
elseif name == RigBuilderLocalized and localization:getText("RigOption", "MeshRig") or "Mesh Rig" then
rig = rigModule.CreateR6MeshRig()
elseif name == RigBuilderLocalized and localization:getText("RigOption", "ManRig") or "Man Rig" then
rig = rigModule.CreateR6MeshBoyRig()
-- ...
end
elseif mode == "R15" then
if name == RigBuilderLocalized and localization:getText("RigOption", "BlockRig") or "Block Rig" then
rig = rigModule.BuildR15Rig()
elseif name == RigBuilderLocalized and localization:getText("RigOption", "ManRig") or "Man Rig" then
rig = rigModule.BuildR15Rig(86500185)
elseif name == RigBuilderLocalized and localization:getText("RigOption", "WomanRig") or "Woman Rig" then
rig = rigModule.BuildR15Rig(86499905)
-- ...
end
end
Regardless of the button selection, the program always ends up following the first branch:
-
name
is always equal toRigBuilderLocalized
-
localization:GetText(...)
always returns a string, which are truthy in Lua. - The last expression following the
or
is not evaluated.
The fix is to parenthesize the conditions, as in the example:
if name == RigBuilderLocalized and localization:getText("RigOption", "BlockRig") or "Block Rig" then
-- becomes...
if name == (RigBuilderLocalized and localization:getText("RigOption", "BlockRig") or "Block Rig") then
Which is probably what the code was supposed to be.
This has been happening for some time now: