mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Fix issue preventing from setting multiple vector properties through a lua script
This commit is contained in:
@@ -308,8 +308,9 @@ bool NumericalProperty<T>::setLuaValue(lua_State* state) {
|
||||
T value = PropertyDelegate<NumericalProperty<T>>::template fromLuaValue<T>(
|
||||
state, success
|
||||
);
|
||||
if (success)
|
||||
if (success) {
|
||||
TemplateProperty<T>::setValue(std::move(value));
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -340,8 +341,9 @@ bool NumericalProperty<T>::setStringValue(std::string value) {
|
||||
T thisValue = PropertyDelegate<NumericalProperty<T>>::template fromString<T>(
|
||||
value, success
|
||||
);
|
||||
if (success)
|
||||
if (success) {
|
||||
TemplateProperty<T>::set(ghoul::any(std::move(thisValue)));
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -402,7 +404,7 @@ std::string NumericalProperty<T>::generateAdditionalJsonDescription() const {
|
||||
|
||||
template <typename T>
|
||||
std::string NumericalProperty<T>::luaToJson(std::string luaValue) const {
|
||||
if(luaValue[0] == '{') {
|
||||
if (luaValue[0] == '{') {
|
||||
luaValue.replace(0, 1, "[");
|
||||
}
|
||||
if (luaValue[luaValue.size() - 1] == '}') {
|
||||
|
||||
Reference in New Issue
Block a user