4 changes: 2 additions & 2 deletions src/serverenvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ class ServerEnvironment : public Environment
bool isFreeServerActiveObjectId(u16 id) const;

/**
* Retrieve the next free activeobject ID
* @return free activeobject ID or zero if not free ID found
* Retrieve the first free ActiveObject ID
* @return free activeobject ID or 0 if none was found
*/
u16 getFreeServerActiveObjectId();

Expand Down
31 changes: 21 additions & 10 deletions src/voxel.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,25 +277,36 @@ class VoxelArea
return index(p.X, p.Y, p.Z);
}

// Translate index in the X coordinate
void add_x(const v3s16 &extent, u32 &i, s16 a)
/**
* Translate index in the X coordinate
*/
static void add_x(const v3s16 &extent, u32 &i, s16 a)
{
i += a;
}
// Translate index in the Y coordinate
void add_y(const v3s16 &extent, u32 &i, s16 a)

/**
* Translate index in the Y coordinate
*/
static void add_y(const v3s16 &extent, u32 &i, s16 a)
{
i += a * extent.X;
}
// Translate index in the Z coordinate
void add_z(const v3s16 &extent, u32 &i, s16 a)

/**
* Translate index in the Z coordinate
*/
static void add_z(const v3s16 &extent, u32 &i, s16 a)
{
i += a * extent.X*extent.Y;
i += a * extent.X * extent.Y;
}
// Translate index in space
void add_p(const v3s16 &extent, u32 &i, v3s16 a)

/**
* Translate index in space
*/
static void add_p(const v3s16 &extent, u32 &i, v3s16 a)
{
i += a.Z*extent.X*extent.Y + a.Y*extent.X + a.X;
i += a.Z * extent.X * extent.Y + a.Y * extent.X + a.X;
}

/*
Expand Down
4 changes: 2 additions & 2 deletions src/voxelalgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,7 @@ void blit_back_with_light(ServerMap *map, MMVManip *vm,
for (relpos.Y = a.MinEdge.Y; relpos.Y <= a.MaxEdge.Y; relpos.Y++) {

// Get old and new node
MapNode oldnode = block->getNodeNoCheck(relpos.X, relpos.Y, relpos.Z, &is_valid);
MapNode oldnode = block->getNodeNoCheck(relpos, &is_valid);
const ContentFeatures &oldf = ndef->get(oldnode);
MapNode newnode = vm->getNodeNoExNoEmerge(relpos + offset);
const ContentFeatures &newf = oldnode == newnode ? oldf :
Expand Down Expand Up @@ -1240,7 +1240,7 @@ void repair_block_light(ServerMap *map, MapBlock *block,
for (relpos.Y = a.MinEdge.Y; relpos.Y <= a.MaxEdge.Y; relpos.Y++) {

// Get node
MapNode node = block->getNodeNoCheck(relpos.X, relpos.Y, relpos.Z, &is_valid);
MapNode node = block->getNodeNoCheck(relpos, &is_valid);
const ContentFeatures &f = ndef->get(node);
// For each light bank
for (size_t b = 0; b < 2; b++) {
Expand Down