Fix array property delegate default value to write a copy instead of a reference when it's a static prop list

console-destruction
Sven Eberhardt 2016-09-04 02:14:30 -04:00
parent dc77020586
commit 3669f28b75
1 changed files with 7 additions and 2 deletions

View File

@ -2782,8 +2782,13 @@ void C4ConsoleQtPropListModel::AddArrayElement()
{
C4Value new_val;
C4PropList *info_proplist = this->info_proplist.getPropList();
if (info_proplist) info_proplist->GetProperty(P_DefaultValue, &new_val);
target_path.DoCall(FormatString("PushBack(%%s, %s)", new_val.GetDataString(10).getData()).getData());
C4PropListStatic *info_proplist_static = nullptr;
if (info_proplist)
{
info_proplist->GetProperty(P_DefaultValue, &new_val);
info_proplist_static = info_proplist->IsStatic();
}
target_path.DoCall(FormatString("PushBack(%%s, %s)", new_val.GetDataString(10, info_proplist_static).getData()).getData());
}
void C4ConsoleQtPropListModel::RemoveArrayElement()