1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

sonarcloud warnings

This commit is contained in:
SoundSSGood 2024-03-08 14:21:29 +02:00
parent 9f688e6fb7
commit d7607983fc
2 changed files with 10 additions and 10 deletions

View File

@ -55,8 +55,8 @@ void CArtifactsOfHeroBase::setPutBackPickedArtifactCallback(PutBackPickedArtCall
}
void CArtifactsOfHeroBase::init(
const CArtPlace::ClickFunctor & lClickCallback,
const CArtPlace::ClickFunctor & showPopupCallback,
const CArtPlace::ClickFunctor & onClickPressedCallback,
const CArtPlace::ClickFunctor & onShowPopupCallback,
const Point & position,
const BpackScrollFunctor & scrollCallback)
{
@ -77,14 +77,14 @@ void CArtifactsOfHeroBase::init(
{
artPlace.second->slot = artPlace.first;
artPlace.second->setArtifact(nullptr);
artPlace.second->setClickPressedCallback(lClickCallback);
artPlace.second->setShowPopupCallback(showPopupCallback);
artPlace.second->setClickPressedCallback(onClickPressedCallback);
artPlace.second->setShowPopupCallback(onShowPopupCallback);
}
for(auto artPlace : backpack)
{
artPlace->setArtifact(nullptr);
artPlace->setClickPressedCallback(lClickCallback);
artPlace->setShowPopupCallback(showPopupCallback);
artPlace->setClickPressedCallback(onClickPressedCallback);
artPlace->setShowPopupCallback(onShowPopupCallback);
}
leftBackpackRoll = std::make_shared<CButton>(Point(379, 364), AnimationPath::builtin("hsbtns3.def"), CButton::tooltip(),
[scrollCallback](){scrollCallback(true);}, EShortcut::MOVE_LEFT);
@ -183,7 +183,7 @@ void CArtifactsOfHeroBase::updateWornSlots()
void CArtifactsOfHeroBase::updateBackpackSlots()
{
ArtifactPosition slot = ArtifactPosition::BACKPACK_START;
for(auto & artPlace : backpack)
for(const auto & artPlace : backpack)
{
setSlotData(artPlace, slot);
slot = slot + 1;

View File

@ -1030,7 +1030,7 @@ struct DLL_LINKAGE EraseArtifact : CArtifactOperationPack
struct DLL_LINKAGE MoveArtifact : CArtifactOperationPack
{
MoveArtifact() = default;
MoveArtifact(const PlayerColor & interfaceOwner, const ArtifactLocation & src, ArtifactLocation & dst, bool askAssemble = true)
MoveArtifact(const PlayerColor & interfaceOwner, const ArtifactLocation & src, const ArtifactLocation & dst, bool askAssemble = true)
: interfaceOwner(interfaceOwner), src(src), dst(dst), askAssemble(askAssemble)
{
}
@ -1089,8 +1089,8 @@ struct DLL_LINKAGE BulkMoveArtifacts : CArtifactOperationPack
}
BulkMoveArtifacts(const PlayerColor & interfaceOwner, const ObjectInstanceID srcArtHolder, const ObjectInstanceID dstArtHolder, bool swap)
: interfaceOwner(interfaceOwner)
, srcArtHolder(std::move(srcArtHolder))
, dstArtHolder(std::move(dstArtHolder))
, srcArtHolder(srcArtHolder)
, dstArtHolder(dstArtHolder)
, swap(swap)
, askAssemble(false)
, srcCreature(std::nullopt)