This commit is contained in:
proller committed 2025-11-17 03:10:05 +01:00
1 parent e52f6d23eb
commit a38e8e4690
5 files changed
+23 -12

No files matched your search

+2
View File
@@ -42,6 +42,8 @@ MARK_AS_ADVANCED(MSGPACK_INCLUDE_DIR MSGPACK_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(msgpack DEFAULT_MSG MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
message(STATUS "Using system msgpack ${MSGPACK_INCLUDE_DIR} ${MSGPACK_LIBRARY}")
elseif(NOT MSGPACK_LIBRARY)
set(MSGPACK_CXX14 1 CACHE INTERNAL "")
set(MSGPACK_CXX17 1 CACHE INTERNAL "")
+1 -1
View File
@@ -166,7 +166,7 @@ void ABMHandler::apply(MapBlock *block, int &blocks_scanned, int &abms_run,
auto &required_neighbors =
activate == 1 ? ir.abmws->required_neighbors_activate
: ir.abmws->required_neighbors;
if (required_neighbors.count() > 0) {
if (!required_neighbors.empty()) {
v3pos_t p1;
int neighbors_range = i->abmws->neighbors_range;
for (p1.X = p.X - neighbors_range; p1.X <= p.X + neighbors_range;
+16 -8
View File
@@ -22,26 +22,34 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.
#include <fm_bitset.h>
FMBitset::FMBitset(size_t capacity):
m_bits(capacity, 0),
m_count(0)
{}
FMBitset::FMBitset(size_t capacity) : m_bits(capacity, 0), m_count(0)
{
}
size_t FMBitset::count() {
size_t FMBitset::count()
{
return m_count;
}
size_t FMBitset::size() {
size_t FMBitset::size()
{
return count();
}
void FMBitset::set(size_t index, bool value) {
void FMBitset::set(size_t index, bool value)
{
if (m_bits[index] != value) {
m_bits[index] = value;
m_count += value ? 1 : -1;
}
}
bool FMBitset::get(size_t index) {
bool FMBitset::get(size_t index)
{
return m_bits[index];
}
bool FMBitset::empty()
{
return !m_count;
}
+3 -2
View File
@@ -26,18 +26,19 @@ along with Freeminer. If not, see <http://www.gnu.org/licenses/>.
#include <cstdlib>
#include <vector>
class FMBitset {
class FMBitset
{
public:
FMBitset(size_t capacity);
size_t count();
size_t size(); // std compat
void set(size_t index, bool value);
bool get(size_t index);
bool empty();
private:
std::vector<char> m_bits;
size_t m_count;
};
#endif
+1 -1
View File
@@ -219,7 +219,7 @@ void NodeBox::msgpack_unpack(msgpack::object o)
type = (NodeBoxType)type_tmp;
//if(type == NODEBOX_FIXED || type == NODEBOX_LEVELED)
if (packet.count(NODEBOX_S_FIXED))
if (packet.contains(NODEBOX_S_FIXED))
packet[NODEBOX_S_FIXED].convert(fixed);
if (type == NODEBOX_WALLMOUNTED) {