diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 11:52:33 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-10-16 11:52:33 +0300 |
commit | 414c61489319a56341ac5be808587c8c3ca84255 (patch) | |
tree | 3a5ea005ac1f69a21246eb3dd95ac0df4ed6be9e /src/environment.cpp | |
parent | a17abae1288eddee9ebf286b9a4ae7fa1bd53586 (diff) | |
download | minetest-414c61489319a56341ac5be808587c8c3ca84255.tar.gz minetest-414c61489319a56341ac5be808587c8c3ca84255.tar.bz2 minetest-414c61489319a56341ac5be808587c8c3ca84255.zip |
Add peaceful / not peaceful distinction in mobs and the only_peaceful_mobs setting
Diffstat (limited to 'src/environment.cpp')
-rw-r--r-- | src/environment.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/environment.cpp b/src/environment.cpp index a88d600bb..f6b9b0a22 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -1039,6 +1039,11 @@ void ServerEnvironment::step(float dtime) i.atEnd()==false; i++) { ServerActiveObject* obj = i.getNode()->getValue(); + // Remove non-peaceful mobs on peaceful mode + if(g_settings->getBool("only_peaceful_mobs")){ + if(!obj->isPeaceful()) + obj->m_removed = true; + } // Don't step if is to be removed or stored statically if(obj->m_removed || obj->m_pending_deactivation) continue; |