mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Fix bonus tree on node move
This commit is contained in:
@ -721,6 +721,20 @@ CBonusSystemNode::CBonusSystemNode(CBonusSystemNode && other):
|
|||||||
std::swap(parents, other.parents);
|
std::swap(parents, other.parents);
|
||||||
std::swap(children, other.children);
|
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
|
//cache ignored
|
||||||
|
|
||||||
//cachedBonuses
|
//cachedBonuses
|
||||||
|
Reference in New Issue
Block a user