mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
fix boat assert
This commit is contained in:
@@ -184,6 +184,7 @@ CBonusSystemNode::~CBonusSystemNode()
|
|||||||
|
|
||||||
void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
|
void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
|
||||||
{
|
{
|
||||||
|
assert(!vstd::contains(parentsToPropagate, &parent));
|
||||||
parentsToPropagate.push_back(&parent);
|
parentsToPropagate.push_back(&parent);
|
||||||
|
|
||||||
attachToSource(parent);
|
attachToSource(parent);
|
||||||
@@ -193,6 +194,7 @@ void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
|
|||||||
if(!parent.actsAsBonusSourceOnly())
|
if(!parent.actsAsBonusSourceOnly())
|
||||||
newRedDescendant(parent);
|
newRedDescendant(parent);
|
||||||
|
|
||||||
|
assert(!vstd::contains(parent.children, this));
|
||||||
parent.children.push_back(this);
|
parent.children.push_back(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,6 +203,7 @@ void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
|
|||||||
|
|
||||||
void CBonusSystemNode::attachToSource(const CBonusSystemNode & parent)
|
void CBonusSystemNode::attachToSource(const CBonusSystemNode & parent)
|
||||||
{
|
{
|
||||||
|
assert(!vstd::contains(parentsToInherit, &parent));
|
||||||
parentsToInherit.push_back(&parent);
|
parentsToInherit.push_back(&parent);
|
||||||
|
|
||||||
++globalCounter;
|
++globalCounter;
|
||||||
|
|||||||
@@ -1319,7 +1319,6 @@ void CGHeroInstance::setBoat(CGBoat* newBoat)
|
|||||||
if (newBoat)
|
if (newBoat)
|
||||||
{
|
{
|
||||||
boardedBoat = newBoat->id;
|
boardedBoat = newBoat->id;
|
||||||
attachTo(*newBoat);
|
|
||||||
newBoat->setBoardedHero(this);
|
newBoat->setBoardedHero(this);
|
||||||
}
|
}
|
||||||
else if (boardedBoat.hasValue())
|
else if (boardedBoat.hasValue())
|
||||||
|
|||||||
Reference in New Issue
Block a user