mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Add peaceful / not peaceful distinction in mobs and the only_peaceful_mobs setting
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user