Fixed bugs related to C# script serialization and deserialization #277

Merged
Pycorax merged 4 commits from SP3-6-c-scripting into main 2022-11-25 00:08:58 +08:00
2 changed files with 17 additions and 1 deletions
Showing only changes of commit 9ada998151 - Show all commits

View File

@ -279,7 +279,15 @@ namespace SHADE
for (int i = 0; i < LIST_SIZE; ++i)
{
// Create the object
System::Object^ obj = System::Activator::CreateInstance(elemType);
System::Object^ obj;
if (elemType == System::String::typeid)
{
obj = gcnew System::String("");
}
else
{
obj = System::Activator::CreateInstance(elemType);
}
// Set it's value
if (varAssignYaml(obj, node[i]))

View File

@ -167,6 +167,10 @@ namespace SHADE
{
valueObj = 0;
}
else
{
return false;
}
}
else
{
@ -181,6 +185,10 @@ namespace SHADE
valueObj = FieldType();
}
}
else
{
return false;
}
}
}