1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Fix bonus tree on node move

This commit is contained in:
AlexVinS 2016-08-15 11:04:45 +03:00
parent d42947f109
commit 69395d4c78

View File

@ -721,6 +721,20 @@ CBonusSystemNode::CBonusSystemNode(CBonusSystemNode && other):
std::swap(parents, other.parents);
std::swap(children, other.children);
//fixing bonus tree without recalculation
for(CBonusSystemNode * n : parents)
{
n->children -= &other;
n->children.push_back(this);
}
for(CBonusSystemNode * n : children)
{
n->parents -= &other;
n->parents.push_back(this);
}
//cache ignored
//cachedBonuses