1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-12 16:58:39 +00:00

Modernize src/c* src/d* and src/e* files (#6263)

* Modernize src/c* src/d* and src/e* files

* default operator
* redundant init
* delete default constructors on CraftDefinition childs (never used)
* fix some missing init values
* const ref fix reported by clang-tidy
* ranged-based for loops
* simple conditions & returns
* empty stl function instead of size
* emplace_back stl function instead of push_back + construct temp obj
* auto for some iterators
* code style fixes
* c++ stl headers instead of C stl headers (stdio.h -> cstdio)
This commit is contained in:
Loïc Blot 2017-08-17 23:02:50 +02:00 committed by GitHub
parent 921151d97a
commit 13e995b811
25 changed files with 298 additions and 343 deletions

View file

@ -67,7 +67,7 @@ public:
if(m_base_position.Y > 8*BS)
m_base_position.Y = 2*BS;
if(send_recommended == false)
if (!send_recommended)
return;
m_timer1 -= dtime;
@ -402,7 +402,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
}
}
if(send_recommended == false)
if (!send_recommended)
return;
if(!isAttached())
@ -423,7 +423,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
}
}
if(m_armor_groups_sent == false){
if (!m_armor_groups_sent) {
m_armor_groups_sent = true;
std::string str = gob_cmd_update_armor_groups(
m_armor_groups);
@ -432,7 +432,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
m_messages_out.push(aom);
}
if(m_animation_sent == false){
if (!m_animation_sent) {
m_animation_sent = true;
std::string str = gob_cmd_update_animation(
m_animation_range, m_animation_speed, m_animation_blend, m_animation_loop);
@ -441,7 +441,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
m_messages_out.push(aom);
}
if(m_bone_position_sent == false){
if (!m_bone_position_sent) {
m_bone_position_sent = true;
for (std::unordered_map<std::string, core::vector2d<v3f>>::const_iterator
ii = m_bone_position.begin(); ii != m_bone_position.end(); ++ii){
@ -453,7 +453,7 @@ void LuaEntitySAO::step(float dtime, bool send_recommended)
}
}
if(m_attachment_sent == false){
if (!m_attachment_sent) {
m_attachment_sent = true;
std::string str = gob_cmd_update_attachment(m_attachment_parent_id, m_attachment_bone, m_attachment_position, m_attachment_rotation);
// create message and add to list
@ -897,7 +897,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
return os.str();
}
void PlayerSAO::getStaticData(std::string *result) const
void PlayerSAO::getStaticData(std::string *) const
{
FATAL_ERROR("Deprecated function");
}
@ -1171,7 +1171,7 @@ int PlayerSAO::punch(v3f dir,
return 0;
// No effect if PvP disabled
if (g_settings->getBool("enable_pvp") == false) {
if (!g_settings->getBool("enable_pvp")) {
if (puncher->getType() == ACTIVEOBJECT_TYPE_PLAYER) {
std::string str = gob_cmd_punched(0, getHP());
// create message and add to list