Avoid crashs of invalid item ids in otb files
This commit is contained in:
parent
7aba117cf2
commit
a88e9f9e0f
|
@ -188,8 +188,12 @@ void Item::setOtbId(uint16 id)
|
||||||
if(!g_things.isValidOtbId(id))
|
if(!g_things.isValidOtbId(id))
|
||||||
id = 0;
|
id = 0;
|
||||||
auto itemType = g_things.getItemType(id);
|
auto itemType = g_things.getItemType(id);
|
||||||
m_id = itemType->getClientId();
|
|
||||||
m_otbId = id;
|
m_otbId = id;
|
||||||
|
|
||||||
|
id = itemType->getClientId();
|
||||||
|
if(!g_things.isValidDatId(id, ThingCategoryItem))
|
||||||
|
id = 0;
|
||||||
|
m_id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item::isValid()
|
bool Item::isValid()
|
||||||
|
|
Loading…
Reference in New Issue