mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Fix if to else if regression.
This commit is contained in:
parent
313c069ecb
commit
278bef8d1a
2 changed files with 24 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ static void setFieldComponent(SimObject* object, StringTableEntry field, const c
|
||||||
|
|
||||||
if (object && field)
|
if (object && field)
|
||||||
prevVal = object->getDataField(field, array);
|
prevVal = object->getDataField(field, array);
|
||||||
if (currentLocalRegister != -1)
|
else if (currentLocalRegister != -1)
|
||||||
prevVal = gEvalState.getLocalStringVariable(currentLocalRegister);
|
prevVal = gEvalState.getLocalStringVariable(currentLocalRegister);
|
||||||
// Set the value on a variable.
|
// Set the value on a variable.
|
||||||
else if (gEvalState.currentVariable)
|
else if (gEvalState.currentVariable)
|
||||||
|
|
|
||||||
|
|
@ -927,6 +927,29 @@ TEST(Script, MiscRegressions)
|
||||||
)");
|
)");
|
||||||
|
|
||||||
ASSERT_EQ(regression2.getInt(), 400);
|
ASSERT_EQ(regression2.getInt(), 400);
|
||||||
|
|
||||||
|
ConsoleValue regression3 = RunScript(R"(
|
||||||
|
function doTest()
|
||||||
|
{
|
||||||
|
%button = new GuiIconButtonCtrl()
|
||||||
|
{
|
||||||
|
active = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
%button.setExtent(120, 20);
|
||||||
|
|
||||||
|
%button.setExtent("120 20");
|
||||||
|
|
||||||
|
%button.extent = "120 20";
|
||||||
|
|
||||||
|
%button.extent.x = 120;
|
||||||
|
%button.extent.y = 20;
|
||||||
|
return %button.extent;
|
||||||
|
}
|
||||||
|
return doTest();
|
||||||
|
)");
|
||||||
|
|
||||||
|
ASSERT_STREQ(regression3.getString(), "120 20");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue