1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Add comments about getArtPlace - it is a bit dangerouse

This commit is contained in:
AlexVinS 2015-02-14 15:58:33 +03:00
parent 7086fdc730
commit c135591f81
2 changed files with 3 additions and 3 deletions

View File

@ -306,7 +306,7 @@ void CArtPlace::deselect ()
{
auto place = ourOwner->getArtPlace(i);
if(nullptr != place)
if(nullptr != place)//getArtPlace may return null
place->pickSlot(false);
}
}
@ -778,7 +778,7 @@ void CArtifactsOfHero::artifactMoved(const ArtifactLocation &src, const Artifact
if(dst.isHolder(aoh->curHero))
{
commonInfo->src.AOH = aoh;
if((ap = aoh->getArtPlace(dst.slot)))
if((ap = aoh->getArtPlace(dst.slot)))//getArtPlace may return null
break;
}
}

View File

@ -118,7 +118,7 @@ public:
void artifactRemoved(const ArtifactLocation &al);
void artifactAssembled(const ArtifactLocation &al);
void artifactDisassembled(const ArtifactLocation &al);
CArtPlace *getArtPlace(int slot);
CArtPlace *getArtPlace(int slot);//may return null
void setHero(const CGHeroInstance * hero);
const CGHeroInstance *getHero() const;