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

weak_ptr removed

This commit is contained in:
SoundSSGood
2024-05-01 21:18:36 +03:00
parent 7abfa7b42a
commit 6a1a6b6864
5 changed files with 122 additions and 147 deletions

View File

@@ -166,6 +166,21 @@ CArtifactsOfHeroBase::ArtPlacePtr CArtifactsOfHeroBase::getArtPlace(const Artifa
}
}
CArtifactsOfHeroBase::ArtPlacePtr CArtifactsOfHeroBase::getArtPlace(const Point & cursorPosition)
{
for(const auto & [slot, artPlace] : artWorn)
{
if(artPlace->pos.isInside(cursorPosition))
return artPlace;
}
for(const auto & artPlace : backpack)
{
if(artPlace->pos.isInside(cursorPosition))
return artPlace;
}
return nullptr;
}
void CArtifactsOfHeroBase::updateWornSlots()
{
for(auto place : artWorn)