]> git.lizzy.rs Git - minetest.git/blobdiff - src/content_sao.cpp
Switch the license to be LGPLv2/later, with small parts still remaining as GPLv2...
[minetest.git] / src / content_sao.cpp
index 810bd5a7c7e7ba83b9a8127a962c0f1c843e96c9..c1a3ded5533437d7c351b2e3c486afb2dfbee1a8 100644 (file)
@@ -3,16 +3,16 @@ Minetest-c55
 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
 
 This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+GNU Lesser General Public License for more details.
 
-You should have received a copy of the GNU General Public License along
+You should have received a copy of the GNU Lesser General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
@@ -389,10 +389,9 @@ void LuaEntitySAO::addedToEnvironment()
                scriptapi_luaentity_get_properties(L, m_id, &m_prop);
                // Initialize HP from properties
                m_hp = m_prop.hp_max;
+               // Activate entity, supplying serialized state
+               scriptapi_luaentity_activate(L, m_id, m_init_state.c_str());
        }
-       
-       // Activate entity, supplying serialized state
-       scriptapi_luaentity_activate(L, m_id, m_init_state.c_str());
 }
 
 ServerActiveObject* LuaEntitySAO::create(ServerEnvironment *env, v3f pos,
@@ -867,7 +866,12 @@ void PlayerSAO::step(float dtime, bool send_recommended)
 
        m_time_from_last_punch += dtime;
        
-       if(!m_is_singleplayer)
+       if(m_is_singleplayer)
+       {
+               m_last_good_position = m_player->getPosition();
+               m_last_good_position_age = 0;
+       }
+       else
        {
                /*
                        Check player movements