Can someone with experience in c++ help me with this logic?
I'm configuring the block respawn system, basically what i need,
player will block respawns 2 floors above and 2 below when they are underground and all levels above if on surface, if the player is on floor 7, he will not block respawn on floor 8.
How do I configure this in this code?
I'm configuring the block respawn system, basically what i need,
player will block respawns 2 floors above and 2 below when they are underground and all levels above if on surface, if the player is on floor 7, he will not block respawn on floor 8.
How do I configure this in this code?
C++:
if (multifloor) {
if (centerPos.z > 7) {
minRangeZ = std::max<int32_t>(centerPos.getZ() - 2, 0);
maxRangeZ = std::min<int32_t>(centerPos.getZ() + 2, MAP_MAX_LAYERS - 1);
} else if (centerPos.z == 6) {
minRangeZ = 0;
maxRangeZ = 8;
} else if (centerPos.z == 7) {
minRangeZ = 0;
maxRangeZ = 9;
} else {
minRangeZ = 0;
maxRangeZ = 7;
}
} else {
minRangeZ = centerPos.z;
maxRangeZ = centerPos.z;
}