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