From 38bd9e93a252cb2dd5ace6b0132514edff38b504 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 18 Jan 2015 23:29:19 -0500 Subject: Fix all warnings and remove -Wno-unused-but-set cflag --- src/content_sao.cpp | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 1edddec7b..d4b3079ec 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -53,7 +53,7 @@ public: // And never save to disk bool isStaticAllowed() const { return false; } - + static ServerActiveObject* create(ServerEnvironment *env, v3f pos, const std::string &data) { @@ -99,7 +99,7 @@ public: } u8 getType() const { return ACTIVEOBJECT_TYPE_TEST; } - + static ServerActiveObject* create(ServerEnvironment *env, v3f pos, const std::string &data) { @@ -170,7 +170,7 @@ class ItemSAO : public ServerActiveObject public: u8 getType() const { return ACTIVEOBJECT_TYPE_ITEM; } - + float getMinimumSavedMovement() { return 0.1*BS; } @@ -212,7 +212,7 @@ public: if(m_move_interval.step(dtime, interval)==false) return; dtime = interval; - + core::aabbox3d box(-BS/3.,0.0,-BS/3., BS/3.,BS*2./3.,BS/3.); collisionMoveResult moveresult; // Apply gravity @@ -223,13 +223,12 @@ public: if(m_speed_f.getLength()*dtime > pos_max_d) m_speed_f *= pos_max_d / (m_speed_f.getLength()*dtime); v3f pos_f = getBasePosition(); - v3f pos_f_old = pos_f; v3f accel_f = v3f(0,0,0); f32 stepheight = 0; moveresult = collisionMoveSimple(m_env,m_env->getGameDef(), pos_max_d, box, stepheight, dtime, pos_f, m_speed_f, accel_f); - + if(send_recommended == false) return; @@ -327,7 +326,7 @@ public: m_itemstring_changed = true; } } - + return 0; } @@ -392,7 +391,7 @@ LuaEntitySAO::LuaEntitySAO(ServerEnvironment *env, v3f pos, ServerActiveObject::registerType(getType(), create); return; } - + // Initialize something to armor groups m_armor_groups["fleshy"] = 100; } @@ -407,11 +406,11 @@ LuaEntitySAO::~LuaEntitySAO() void LuaEntitySAO::addedToEnvironment(u32 dtime_s) { ServerActiveObject::addedToEnvironment(dtime_s); - + // Create entity from name m_registered = m_env->getScriptIface()-> luaentity_Add(m_id, m_init_name.c_str()); - + if(m_registered){ // Get properties m_env->getScriptIface()-> @@ -671,10 +670,10 @@ int LuaEntitySAO::punch(v3f dir, return 0; } - // It's best that attachments cannot be punched + // It's best that attachments cannot be punched if(isAttached()) return 0; - + ItemStack *punchitem = NULL; ItemStack punchitem_static; if(puncher){ @@ -687,11 +686,11 @@ int LuaEntitySAO::punch(v3f dir, toolcap, punchitem, time_from_last_punch); - + if(result.did_punch) { setHP(getHP() - result.damage); - + std::string punchername = "nil"; @@ -701,7 +700,7 @@ int LuaEntitySAO::punch(v3f dir, actionstream<movement_speed_fast; - player_max_speed_up = m_player->movement_speed_fast; } else { // Normal speed player_max_speed = m_player->movement_speed_walk; - player_max_speed_up = m_player->movement_speed_walk; } // Tolerance. With the lag pool we shouldn't need it. //player_max_speed *= 2.5; -- cgit v1.2.3