mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
sitä sun tätä tekeillä, toimii kivasti
This commit is contained in:
parent
e8fd5eb8ee
commit
c707e00195
19 changed files with 998 additions and 761 deletions
|
@ -38,7 +38,9 @@ enum
|
|||
{
|
||||
NODECONTAINER_ID_MAPBLOCK,
|
||||
NODECONTAINER_ID_MAPSECTOR,
|
||||
NODECONTAINER_ID_MAP
|
||||
NODECONTAINER_ID_MAP,
|
||||
NODECONTAINER_ID_MAPBLOCKCACHE,
|
||||
NODECONTAINER_ID_VOXELMANIPULATOR,
|
||||
};
|
||||
|
||||
class NodeContainer
|
||||
|
@ -245,6 +247,35 @@ public:
|
|||
setNode(p.X, p.Y, p.Z, n);
|
||||
}
|
||||
|
||||
/*
|
||||
Non-checking variants of the above
|
||||
*/
|
||||
|
||||
MapNode getNodeNoCheck(s16 x, s16 y, s16 z)
|
||||
{
|
||||
if(data == NULL)
|
||||
throw InvalidPositionException();
|
||||
return data[z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + y*MAP_BLOCKSIZE + x];
|
||||
}
|
||||
|
||||
MapNode getNodeNoCheck(v3s16 p)
|
||||
{
|
||||
return getNodeNoCheck(p.X, p.Y, p.Z);
|
||||
}
|
||||
|
||||
void setNodeNoCheck(s16 x, s16 y, s16 z, MapNode & n)
|
||||
{
|
||||
if(data == NULL)
|
||||
throw InvalidPositionException();
|
||||
data[z*MAP_BLOCKSIZE*MAP_BLOCKSIZE + y*MAP_BLOCKSIZE + x] = n;
|
||||
setChangedFlag();
|
||||
}
|
||||
|
||||
void setNodeNoCheck(v3s16 p, MapNode & n)
|
||||
{
|
||||
setNodeNoCheck(p.X, p.Y, p.Z, n);
|
||||
}
|
||||
|
||||
/*
|
||||
These functions consult the parent container if the position
|
||||
is not valid on this MapBlock.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue