1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Use toEntity/toXXX methods in Identifier instead VLC objects access

This commit is contained in:
Ivan Savenko
2023-11-02 18:45:46 +02:00
parent 8d5fa41a19
commit 184f5a72cc
29 changed files with 101 additions and 90 deletions

View File

@ -147,7 +147,7 @@ std::string CGMine::getHoverText(PlayerColor player) const
std::string hoverName = CArmedInstance::getHoverText(player);
if (tempOwner != PlayerColor::NEUTRAL)
hoverName += "\n(" + VLC->generaltexth->restypes[producedResource] + ")";
hoverName += "\n(" + VLC->generaltexth->restypes[producedResource.getNum()] + ")";
if(stacksCount())
{
@ -252,7 +252,7 @@ GameResID CGResource::resourceID() const
std::string CGResource::getHoverText(PlayerColor player) const
{
return VLC->generaltexth->restypes[resourceID()];
return VLC->generaltexth->restypes[resourceID().getNum()];
}
void CGResource::pickRandomObject(CRandomGenerator & rand)
@ -760,7 +760,7 @@ void CGArtifact::initObj(CRandomGenerator & rand)
storedArtifact = a;
}
if(!storedArtifact->artType)
storedArtifact->setType(VLC->arth->objects[getArtifact()]);
storedArtifact->setType(VLC->arth->objects[getArtifact().getNum()]);
}
if(ID == Obj::SPELL_SCROLL)
subID = 1;