Fix issues detected by Sonar

This commit is contained in:
Ivan Savenko
2025-05-11 19:50:57 +03:00
parent cb5295b9ec
commit 4b30336d03
37 changed files with 94 additions and 114 deletions
+8
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);