1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

fixed CAddInfo::operator[] (mutable version)

This commit is contained in:
Henning Koehler
2018-03-17 11:03:02 +13:00
parent 7f76648a7c
commit 68b757eb53
2 changed files with 9 additions and 2 deletions

View File

@@ -178,6 +178,13 @@ bool CAddInfo::operator!=(si32 value) const
return !operator==(value);
}
si32 & CAddInfo::operator[](size_type pos)
{
if (pos <= size())
resize(pos + 1, CAddInfo::NONE);
return vector::operator[](pos);
}
si32 CAddInfo::operator[](size_type pos) const
{
return pos < size() ? vector::operator[](pos) : CAddInfo::NONE;