1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

final fixup

This commit is contained in:
SoundSSGood
2023-05-23 20:24:55 +03:00
parent 1175990724
commit 1366825f08
7 changed files with 36 additions and 28 deletions

View File

@@ -10,6 +10,7 @@
#include "StdInc.h"
#include "CCreatureSet.h"
#include "ArtifactUtils.h"
#include "CConfigHandler.h"
#include "CCreatureHandler.h"
#include "VCMI_Lib.h"
@@ -870,7 +871,20 @@ ArtBearer::ArtBearer CStackInstance::bearerType() const
void CStackInstance::putArtifact(ArtifactPosition pos, CArtifactInstance * art)
{
assert(!getArt(pos));
art->putAt(ArtifactLocation(this, pos));
assert(art->artType->canBePutAt(this, pos));
CArtifactSet::putArtifact(pos, art);
if(ArtifactUtils::isSlotEquipment(pos))
attachTo(*art);
}
void CStackInstance::removeArtifact(ArtifactPosition pos)
{
assert(getArt(pos));
CArtifactSet::removeArtifact(pos);
if(ArtifactUtils::isSlotEquipment(pos))
detachFrom(*getArt(pos));
}
void CStackInstance::serializeJson(JsonSerializeFormat & handler)