mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Fix artifact->artifactID.hasValue() nullptr
This commit is contained in:
@@ -52,9 +52,11 @@ void PackRollbackGeneratorVisitor::visitRebalanceStacks(RebalanceStacks & pack)
|
||||
const auto * srcArmy = dynamic_cast<const CArmedInstance *>(srcObject);
|
||||
const auto * dstArmy = dynamic_cast<const CArmedInstance *>(dstObject);
|
||||
|
||||
const auto * artifact = srcArmy->getStack(pack.srcSlot).getSlot(ArtifactPosition::CREATURE_SLOT);
|
||||
|
||||
if (srcArmy->getStack(pack.srcSlot).getTotalExperience() != 0 ||
|
||||
dstArmy->getStack(pack.srcSlot).getTotalExperience() != 0 ||
|
||||
srcArmy->getStack(pack.srcSlot).getSlot(ArtifactPosition::CREATURE_SLOT)->artifactID.hasValue())
|
||||
(artifact && artifact->artifactID.hasValue()))
|
||||
{
|
||||
// TODO: rollback creature artifacts & stack experience
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user