mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-12 04:11:06 -05:00
Fix temp var mapping not working after copy-paste of segment
This commit is contained in:
@@ -56,6 +56,22 @@ void MacroSegment::SetVarMappings(const std::vector<VarMapping> &mappings)
|
||||
_varMappings = mappings;
|
||||
}
|
||||
|
||||
void MacroSegment::FixupVarMappingRefs(const MacroSegment *originalSegment)
|
||||
{
|
||||
for (auto &mapping : _varMappings) {
|
||||
auto refSeg = mapping.tempVar._segment.lock();
|
||||
if (refSeg.get() != originalSegment) {
|
||||
continue;
|
||||
}
|
||||
for (const auto &var : _tempVariables) {
|
||||
if (var.ID() == mapping.tempVar._id) {
|
||||
mapping.tempVar = var.GetRef();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<TempVariable> MacroSegment::GetOwnTempVars() const
|
||||
{
|
||||
return _tempVariables;
|
||||
|
||||
Reference in New Issue
Block a user