1
0
forked from 0ad/0ad

Off-by-one bug in the CEntityList Serialize method; was storing the last entity twice

This was SVN commit r2320.
This commit is contained in:
Simon Brenner 2005-05-18 22:03:02 +00:00
parent f1e9bf6227
commit f61a5d1c25

View File

@ -137,7 +137,7 @@ uint CEntityList::GetSerializedLength() const
u8 *CEntityList::Serialize(u8 *buffer) const
{
for (size_t i=0;i<size();i++)
for (size_t i=0;i<(size()-1);i++)
Serialize_int_2(buffer, at(i).m_handle);
Serialize_int_2(buffer, back().m_handle | HANDLE_SENTINEL_BIT);
return buffer;