BlockArea: Added runtime check for coords in Debug mode
git-svn-id: http://mc-server.googlecode.com/svn/trunk@1337 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
d441096d62
commit
e993e32410
@ -1636,6 +1636,13 @@ bool cBlockArea::SetSize(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
|
|||||||
|
|
||||||
int cBlockArea::MakeIndex(int a_RelX, int a_RelY, int a_RelZ) const
|
int cBlockArea::MakeIndex(int a_RelX, int a_RelY, int a_RelZ) const
|
||||||
{
|
{
|
||||||
|
ASSERT(a_RelX >= 0);
|
||||||
|
ASSERT(a_RelX < m_SizeX);
|
||||||
|
ASSERT(a_RelY >= 0);
|
||||||
|
ASSERT(a_RelY < m_SizeY);
|
||||||
|
ASSERT(a_RelZ >= 0);
|
||||||
|
ASSERT(a_RelZ < m_SizeZ);
|
||||||
|
|
||||||
return a_RelX + a_RelZ * m_SizeX + a_RelY * m_SizeX * m_SizeZ;
|
return a_RelX + a_RelZ * m_SizeX + a_RelY * m_SizeX * m_SizeZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user