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

Fix issues detected by Sonar

This commit is contained in:
Ivan Savenko
2025-05-05 16:05:59 +03:00
parent cb5295b9ec
commit 4b30336d03
37 changed files with 94 additions and 114 deletions

View File

@@ -348,6 +348,14 @@ std::string CCreature::nodeName() const
return "\"" + getNamePluralTextID() + "\"";
}
int CCreature::getRandomAmount(vstd::RNG & ranGen) const
{
if(ammMax > ammMin)
return ammMin + (ranGen.nextInt(ammMin, ammMax));
else
return ammMax;
}
void CCreature::updateFrom(const JsonNode & data)
{
JsonUpdater handler(nullptr, data);