mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
CGameHandler::moveArtifact: check lock status by slot instead of id
This one fix issue 2455. We still need to do something with ArtifactID::ART_LOCK or ids for artifact from mods since they might conflict with each other.
This commit is contained in:
@@ -3193,7 +3193,10 @@ bool CGameHandler::moveArtifact(const ArtifactLocation &al1, const ArtifactLocat
|
||||
&& srcArtifact && !srcArtifact->canBePutAt(dst, true))
|
||||
COMPLAIN_RET("Cannot move artifact!");
|
||||
|
||||
if ((srcArtifact && srcArtifact->artType->id == ArtifactID::ART_LOCK) || (destArtifact && destArtifact->artType->id == ArtifactID::ART_LOCK))
|
||||
auto srcSlot = src.getSlot();
|
||||
auto dstSlot = dst.getSlot();
|
||||
|
||||
if ((srcSlot && srcSlot->locked) || (dstSlot && dstSlot->locked))
|
||||
COMPLAIN_RET("Cannot move artifact locks.");
|
||||
|
||||
if (dst.slot >= GameConstants::BACKPACK_START && srcArtifact->artType->isBig())
|
||||
|
||||
Reference in New Issue
Block a user