Trivial optimization for static entities

This commit is contained in:
Lars Mueller 2024-05-20 01:52:59 +02:00
parent 72cb77b0f3
commit 38f83730c3

View File

@ -15,8 +15,9 @@ ServerActiveObject::ServerActiveObject(ServerEnvironment *env, v3f pos):
}
void ServerActiveObject::setBasePosition(v3f pos) {
bool changed = m_base_position != pos;
m_base_position = pos;
if (m_env) // HACK this doesn't feel right; *when* is m_env null?
if (changed && m_env) // HACK this doesn't feel right; *when* is m_env null?
ServerEnvironment_updatePos(m_env, pos, getId());
}