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:
parent
d42947f109
commit
69395d4c78
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user