mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #2135 from SoundSSGood/assert-failure-fix
CWindowWithArtifacts assert fix
This commit is contained in:
commit
c21d31289e
@ -229,8 +229,7 @@ void CWindowWithArtifacts::artifactMoved(const ArtifactLocation & srcLoc, const
|
||||
// we have a different artifact may look surprising... but it's valid.
|
||||
|
||||
auto pickedArtInst = std::get<const CArtifactInstance*>(curState.value());
|
||||
assert(srcLoc.isHolder(std::get<const CGHeroInstance*>(curState.value())));
|
||||
assert(srcLoc.getArt() == pickedArtInst);
|
||||
assert(!pickedArtInst || destLoc.isHolder(std::get<const CGHeroInstance*>(curState.value())));
|
||||
|
||||
auto artifactMovedBody = [this, withRedraw, &srcLoc, &destLoc, &pickedArtInst](auto artSetWeak) -> void
|
||||
{
|
||||
|
@ -1835,9 +1835,7 @@ void EraseArtifact::applyGs(CGameState *gs)
|
||||
void MoveArtifact::applyGs(CGameState * gs)
|
||||
{
|
||||
CArtifactInstance * art = src.getArt();
|
||||
if(!ArtifactUtils::isSlotBackpack(dst.slot))
|
||||
assert(!dst.getArt());
|
||||
|
||||
assert(!ArtifactUtils::isSlotEquipment(dst.slot) || !dst.getArt());
|
||||
art->move(src, dst);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user