master #6

Merged
BRNSystems merged 85 commits from Mirrorlandia_minetest/minetest:master into master 2024-01-09 17:53:52 +01:00
Showing only changes of commit 431444ba9f - Show all commits

@ -394,18 +394,22 @@ void ActiveBlockList::update(std::vector<PlayerSAO*> &active_players,
std::inserter(blocks_removed, blocks_removed.end())); std::inserter(blocks_removed, blocks_removed.end()));
/* /*
Some sanity checks Do some least-effort sanity checks to hopefully catch code bugs.
*/ */
assert(newlist.size() >= extralist.size()); assert(newlist.size() >= extralist.size());
assert(blocks_removed.size() <= m_list.size()); assert(blocks_removed.size() <= m_list.size());
if (!blocks_added.empty()) if (!blocks_added.empty()) {
assert(newlist.count(*blocks_added.begin()) > 0); assert(newlist.count(*blocks_added.begin()) > 0);
assert(blocks_removed.count(*blocks_added.begin()) == 0);
}
if (!extra_blocks_added.empty()) { if (!extra_blocks_added.empty()) {
assert(newlist.count(*extra_blocks_added.begin()) > 0); assert(newlist.count(*extra_blocks_added.begin()) > 0);
assert(extralist.count(*extra_blocks_added.begin()) > 0);
assert(blocks_added.count(*extra_blocks_added.begin()) == 0); assert(blocks_added.count(*extra_blocks_added.begin()) == 0);
} }
if (!blocks_removed.empty()) { if (!blocks_removed.empty()) {
assert(newlist.count(*blocks_removed.begin()) == 0); assert(newlist.count(*blocks_removed.begin()) == 0);
assert(extralist.count(*blocks_removed.begin()) == 0);
assert(m_list.count(*blocks_removed.begin()) > 0); assert(m_list.count(*blocks_removed.begin()) > 0);
} }