1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

missing replacement

This commit is contained in:
Laserlicht
2025-09-17 20:15:57 +02:00
committed by GitHub
parent 0cc9c62e8a
commit c8e13f1fd0

View File

@@ -124,7 +124,7 @@ std::string ResourceSet::toString() const
bool ResourceSet::nziterator::valid() const
{
return cur.resType < GameResID::COUNT && cur.resVal;
return static_cast<int>(cur.resType) < LIBRARY->resourceTypeHandler->getAllObjects().size() && cur.resVal;
}
ResourceSet::nziterator ResourceSet::nziterator::operator++()
@@ -155,9 +155,9 @@ void ResourceSet::nziterator::advance()
do
{
++cur.resType;
} while(cur.resType < GameResID::COUNT && !(cur.resVal=rs[cur.resType]));
} while(static_cast<int>(cur.resType) < LIBRARY->resourceTypeHandler->getAllObjects().size() && !(cur.resVal=rs[cur.resType]));
if(cur.resType >= GameResID::COUNT)
if(static_cast<int>(cur.resType) >= LIBRARY->resourceTypeHandler->getAllObjects().size())
cur.resVal = -1;
}