forked from Mirrorlandia_minetest/minetest
master #6
@ -394,18 +394,22 @@ void ActiveBlockList::update(std::vector<PlayerSAO*> &active_players,
|
||||
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(blocks_removed.size() <= m_list.size());
|
||||
if (!blocks_added.empty())
|
||||
if (!blocks_added.empty()) {
|
||||
assert(newlist.count(*blocks_added.begin()) > 0);
|
||||
assert(blocks_removed.count(*blocks_added.begin()) == 0);
|
||||
}
|
||||
if (!extra_blocks_added.empty()) {
|
||||
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);
|
||||
}
|
||||
if (!blocks_removed.empty()) {
|
||||
assert(newlist.count(*blocks_removed.begin()) == 0);
|
||||
assert(extralist.count(*blocks_removed.begin()) == 0);
|
||||
assert(m_list.count(*blocks_removed.begin()) > 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user