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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user