1
0

Fix server-crash with non-existing items.

This commit is contained in:
Howaner
2014-07-01 14:47:49 +02:00
parent 24c86df12e
commit 64f6ddf1e2
2 changed files with 8 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ cItemHandler * cItemHandler::m_ItemHandler[2268];
cItemHandler * cItemHandler::GetItemHandler(int a_ItemType)
{
if (a_ItemType < 0)
if ((a_ItemType < 0) || (a_ItemType >= ARRAYCOUNT(m_ItemHandler)) || (!IsValidBlock(a_ItemType) && !IsValidItem(a_ItemType)))
{
// Either nothing (-1), or bad value, both cases should return the air handler
if (a_ItemType < -1)