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

Add peaceful / not peaceful distinction in mobs and the only_peaceful_mobs setting

This commit is contained in:
Perttu Ahola 2011-10-16 11:52:33 +03:00
parent a17abae128
commit 414c614893
6 changed files with 18 additions and 0 deletions

View file

@ -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");