{
if(sendlist.size() == 255 || i == deleted_blocks.end())
{
- if(sendlist.size() == 0)
+ if(sendlist.empty())
break;
/*
[0] u16 command
}
}
// Sync to server
- if(removed_server_ids.size() != 0)
+ if(!removed_server_ids.empty())
{
std::ostringstream os(std::ios_base::binary);
writeU16(os, TOSERVER_REMOVED_SOUNDS);
m_clients_names.clear();
- if(clients.size() != 0)
+ if(!clients.empty())
infostream<<"Players:"<<std::endl;
for(std::list<u16>::iterator
i = clients.begin();
{
std::list<u16> peerIds = m_connection->getPeerIDs();
- if ((this->m_outgoing_queue.size() > 0) && (peerIds.size() > 0))
+ if (!m_outgoing_queue.empty() && !peerIds.empty())
return true;
for(std::list<u16>::iterator j = peerIds.begin();
void GenericCAO::updateBonePosition()
{
- if(!m_bone_position.size() || m_animated_meshnode == NULL)
+ if(m_bone_position.empty() || m_animated_meshnode == NULL)
return;
m_animated_meshnode->setJointMode(irr::scene::EJUOR_CONTROL); // To write positions to the mesh on render
if(block==NULL)
return;
// Ignore if no stored objects (to not set changed flag)
- if(block->m_static_objects.m_stored.size() == 0)
+ if(block->m_static_objects.m_stored.empty())
return;
verbosestream<<"ServerEnvironment::activateObjects(): "
<<"activating objects of block "<<PP(block->getPos())
assert(*i != menu);
}
- if(m_stack.size() != 0)
+ if(!m_stack.empty())
m_stack.back()->setVisible(false);
m_stack.push_back(menu);
}
assert(*i == menu);
m_stack.erase(i);*/
- if(m_stack.size() != 0)
+ if(!m_stack.empty())
m_stack.back()->setVisible(true);
}
// Returns true to prevent further processing
virtual bool preprocessEvent(const SEvent& event)
{
- if(m_stack.size() != 0)
+ if(!m_stack.empty())
return m_stack.back()->preprocessEvent(event);
else
return false;
v3s16(-1,0,0), // left
};
- if(from_nodes.size() == 0)
+ if(from_nodes.empty())
return;
u32 blockchangecount = 0;
<<" for "<<from_nodes.size()<<" nodes"
<<std::endl;*/
- if(unlighted_nodes.size() > 0)
+ if(!unlighted_nodes.empty())
unspreadLight(bank, unlighted_nodes, light_sources, modified_blocks);
}
v3s16(-1,0,0), // left
};
- if(from_nodes.size() == 0)
+ if(from_nodes.empty())
return;
u32 blockchangecount = 0;
<<" for "<<from_nodes.size()<<" nodes"
<<std::endl;*/
- if(lighted_nodes.size() > 0)
+ if(!lighted_nodes.empty())
spreadLight(bank, lighted_nodes, modified_blocks);
}
if (mg->biomemap) {
std::set<u8>::iterator iter;
- if (biomes.size()) {
+ if (!biomes.empty()) {
iter = biomes.find(mg->biomemap[mapindex]);
if (iter == biomes.end())
continue;
for (it = idset.begin(); it != idset.end(); ++it)
output->push_back(*it);
- if (idset.size() == 0) {
+ if (idset.empty()) {
num_failed++;
errorstream << "NodeResolver::resolveNodes(): Failed to "
"resolve '" << name << "'" << std::endl;
Version 0 is a placeholder for "nothing to see here; go away."
*/
- if(m_data.size() == 0){
+ if(m_data.empty()){
writeU8(os, 0); // version
return;
}
{
if(map_format_version == 24){
// Version 0 is a placeholder for "nothing to see here; go away."
- if(m_data.size() == 0){
+ if(m_data.empty()){
writeU8(os, 0); // version
return;
}
/*
Set the modified blocks unsent for all the clients
*/
- if(modified_blocks.size() > 0)
+ if(!modified_blocks.empty())
{
SetBlocksNotSent(modified_blocks);
}
client->m_known_objects, added_objects);
// Ignore if nothing happened
- if(removed_objects.size() == 0 && added_objects.size() == 0)
+ if(removed_objects.empty() && added_objects.empty())
{
//infostream<<"active objects: none changed"<<std::endl;
continue;
/*
Set blocks not sent to far players
*/
- if(far_players.size() > 0)
+ if(!far_players.empty())
{
// Convert list format to that wanted by SetBlocksNotSent
std::map<v3s16, MapBlock*> modified_blocks2;
continue;
ServerPlayingSound &psound = i->second;
psound.clients.erase(peer_id);
- if(psound.clients.size() == 0)
+ if(psound.clients.empty())
m_playing_sounds.erase(i++);
}
}
dst_clients.push_back(*i);
}
}
- if(dst_clients.size() == 0)
+ if(dst_clients.empty())
return -1;
// Create the sound
{
ServerPlayingSound &psound = i->second;
psound.clients.erase(peer_id);
- if(psound.clients.size() == 0)
+ if(psound.clients.empty())
m_playing_sounds.erase(i++);
else
i++;
}
}
}
- if(del_list.size() != 0)
+ if(!del_list.empty())
verbosestream<<"OpenALSoundManager::maintain(): deleting "
<<del_list.size()<<" playing sounds"<<std::endl;
for(std::set<int>::iterator i = del_list.begin();
std::map<v3s16, u8> & from_nodes,
std::set<v3s16> & light_sources, INodeDefManager *nodemgr)
{
- if(from_nodes.size() == 0)
+ if(from_nodes.empty())
return;
for(std::map<v3s16, u8>::iterator j = from_nodes.begin();
v3s16(-1,0,0), // left
};
- if(from_nodes.size() == 0)
+ if(from_nodes.empty())
return;
std::set<v3s16> lighted_nodes;
<<" for "<<from_nodes.size()<<" nodes"
<<std::endl;*/
- if(lighted_nodes.size() > 0)
+ if(!lighted_nodes.empty())
spreadLight(bank, lighted_nodes, nodemgr);
}
#endif