fix boat assert

This commit is contained in:
Laserlicht committed 2025-11-02 21:26:49 +01:00
1 parent 743013a0d6
commit 60dacab361
2 files changed
+3 -1

No files matched your search

+3
View File
@@ -184,6 +184,7 @@ CBonusSystemNode::~CBonusSystemNode()
void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
{
assert(!vstd::contains(parentsToPropagate, &parent));
parentsToPropagate.push_back(&parent);
attachToSource(parent);
@@ -193,6 +194,7 @@ void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
if(!parent.actsAsBonusSourceOnly())
newRedDescendant(parent);
assert(!vstd::contains(parent.children, this));
parent.children.push_back(this);
}
@@ -201,6 +203,7 @@ void CBonusSystemNode::attachTo(CBonusSystemNode & parent)
void CBonusSystemNode::attachToSource(const CBonusSystemNode & parent)
{
assert(!vstd::contains(parentsToInherit, &parent));
parentsToInherit.push_back(&parent);
++globalCounter;
-1
View File
@@ -1319,7 +1319,6 @@ void CGHeroInstance::setBoat(CGBoat* newBoat)
if (newBoat)
{
boardedBoat = newBoat->id;
attachTo(*newBoat);
newBoat->setBoardedHero(this);
}
else if (boardedBoat.hasValue())