aboutsummaryrefslogtreecommitdiff
path: root/src/content_sao.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-16 11:52:33 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-16 11:52:33 +0300
commit414c61489319a56341ac5be808587c8c3ca84255 (patch)
tree3a5ea005ac1f69a21246eb3dd95ac0df4ed6be9e /src/content_sao.cpp
parenta17abae1288eddee9ebf286b9a4ae7fa1bd53586 (diff)
downloadminetest-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/content_sao.cpp')
-rw-r--r--src/content_sao.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 8b1002c5a..e218fc765 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -1370,6 +1370,11 @@ u16 MobV2SAO::punch(const std::string &toolname, v3f dir,
return 65536/100;
}
+bool MobV2SAO::isPeaceful()
+{
+ return m_properties->getBool("is_peaceful");
+}
+
void MobV2SAO::sendPosition()
{
m_last_sent_position = m_base_position;
@@ -1388,6 +1393,7 @@ void MobV2SAO::sendPosition()
void MobV2SAO::setPropertyDefaults()
{
+ m_properties->setDefault("is_peaceful", "false");
m_properties->setDefault("move_type", "ground_nodes");
m_properties->setDefault("speed", "(0,0,0)");
m_properties->setDefault("age", "0");