mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fix build in debug mode
This commit is contained in:
parent
9acab48bc3
commit
37f3560b9c
@ -125,7 +125,7 @@ DLL_LINKAGE std::vector<const CArtifact*> ArtifactUtils::assemblyPossibilities(
|
||||
|
||||
for(const auto artifact : art->getPartOf())
|
||||
{
|
||||
assert(artifact->constituents);
|
||||
assert(artifact->isCombined());
|
||||
bool possible = true;
|
||||
|
||||
for(const auto constituent : artifact->getConstituents()) //check if all constituents are available
|
||||
@ -171,7 +171,7 @@ DLL_LINKAGE CArtifactInstance * ArtifactUtils::createNewArtifactInstance(CArtifa
|
||||
auto * artInst = new CArtifactInstance(art);
|
||||
if(art->isCombined())
|
||||
{
|
||||
assert(art->constituents);
|
||||
assert(art->isCombined());
|
||||
for(const auto & part : art->getConstituents())
|
||||
artInst->addPart(ArtifactUtils::createNewArtifactInstance(part), ArtifactPosition::PRE_FIRST);
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ bool CArtifact::canBePutAt(const CArtifactSet * artSet, ArtifactPosition slot, b
|
||||
fittingSet.artifactsWorn = artSet->artifactsWorn;
|
||||
if(assumeDestRemoved)
|
||||
fittingSet.removeArtifact(slot);
|
||||
assert(constituents);
|
||||
|
||||
for(const auto art : constituents)
|
||||
{
|
||||
auto possibleSlot = ArtifactUtils::getArtAnyPosition(&fittingSet, art->getId());
|
||||
|
@ -20,7 +20,7 @@ VCMI_LIB_NAMESPACE_BEGIN
|
||||
void CCombinedArtifactInstance::addPart(CArtifactInstance * art, const ArtifactPosition & slot)
|
||||
{
|
||||
auto artInst = static_cast<CArtifactInstance*>(this);
|
||||
assert(vstd::contains_if(*artInst->artType->constituents,
|
||||
assert(vstd::contains_if(artInst->artType->getConstituents(),
|
||||
[=](const CArtifact * partType)
|
||||
{
|
||||
return partType->getId() == art->getTypeId();
|
||||
|
@ -1530,7 +1530,6 @@ void NewArtifact::applyGs(CGameState *gs)
|
||||
art->setType(art->artType);
|
||||
if(art->isCombined())
|
||||
{
|
||||
assert(art->artType->getConstituents());
|
||||
for(const auto & part : art->artType->getConstituents())
|
||||
art->addPart(ArtifactUtils::createNewArtifactInstance(part), ArtifactPosition::PRE_FIRST);
|
||||
}
|
||||
|
@ -473,7 +473,7 @@ void CMap::addNewArtifactInstance(CArtifactInstance * art)
|
||||
void CMap::eraseArtifactInstance(CArtifactInstance * art)
|
||||
{
|
||||
//TODO: handle for artifacts removed in map editor
|
||||
assert(artInstances[art->id.getNum()] == art);
|
||||
assert(artInstances[art->getId().getNum()] == art);
|
||||
artInstances[art->getId().getNum()].dellNull();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user