1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Fixes for multiple new issues from Sonar

This commit is contained in:
Ivan Savenko
2025-02-20 16:57:52 +00:00
parent 0548f325e4
commit 2362c6da21
50 changed files with 190 additions and 223 deletions

View File

@@ -325,7 +325,7 @@ TObjectTypeHandler CGHeroInstance::getObjectHandler() const
void CGHeroInstance::updateAppearance()
{
auto handler = VLC->objtypeh->getHandlerFor(Obj::HERO, getHeroClass()->getIndex());;
auto handler = VLC->objtypeh->getHandlerFor(Obj::HERO, getHeroClass()->getIndex());
auto terrain = cb->gameState()->getTile(visitablePos())->getTerrainID();
auto app = handler->getOverride(terrain, this);
if (app)
@@ -341,7 +341,7 @@ void CGHeroInstance::initHero(vstd::RNG & rand)
if (ID == Obj::HERO)
{
auto handler = VLC->objtypeh->getHandlerFor(Obj::HERO, getHeroClass()->getIndex());;
auto handler = VLC->objtypeh->getHandlerFor(Obj::HERO, getHeroClass()->getIndex());
appearance = handler->getTemplates().front();
}

View File

@@ -156,7 +156,7 @@ void CQuest::completeQuest(IGameCallback * cb, const CGHeroInstance *h) const
const auto * assembly = h->getCombinedArtWithPart(elem);
if (assembly)
{
auto parts = assembly->getPartsInfo(); // FIXME: causes crashes on Google Play
auto parts = assembly->getPartsInfo();
// Remove the assembly
cb->removeArtifact(ArtifactLocation(h->id, h->getArtPos(assembly)));