Skip to content

Instantly share code, notes, and snippets.

@xyzz

xyzz/gist:3996063

Created Nov 1, 2012
Embed
What would you like to do?
diff --git a/src/environment.cpp b/src/environment.cpp
index 3ba0a21..abb3cbd 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -992,7 +992,20 @@ void ServerEnvironment::step(float dtime)
floatToInt(player->getPosition(), BS));
players_blockpos.push_back(blockpos);
}
-
+
+ for(core::map<u16, ServerActiveObject*>::Iterator
+ i = m_active_objects.getIterator();
+ i.atEnd()==false; i++)
+ {
+ ServerActiveObject* obj = i.getNode()->getValue();
+ if(obj->getType() == ACTIVEOBJECT_TYPE_PLAYER)
+ continue;
+ v3s16 blockpos = getNodeBlockPos(
+ floatToInt(obj->getBasePosition(), BS));
+ players_blockpos.push_back(blockpos);
+ std::cerr << "added" << std::endl;
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment