1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +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

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