Base validation for building:levels on a client side.

This commit is contained in:
Alex Zolotarev 2016-03-31 10:26:04 +03:00
parent dd8be8cc6e
commit f5d1ff127f

View file

@ -161,7 +161,10 @@ void EditableMapObject::SetFlats(string const & flats)
void EditableMapObject::SetBuildingLevels(string const & buildingLevels)
{
m_metadata.Set(feature::Metadata::FMD_BUILDING_LEVELS, buildingLevels);
auto constexpr kMaximumLevelsEditableByUsers = 50;
uint64_t levels;
if (strings::to_uint64(buildingLevels, levels) && levels <= kMaximumLevelsEditableByUsers)
m_metadata.Set(feature::Metadata::FMD_BUILDING_LEVELS, buildingLevels);
}
string const & EditableMapObject::GetStreet() const { return m_street; }