summaryrefslogtreecommitdiff
path: root/src/serverenvironment.h
diff options
context:
space:
mode:
authorlhofhansl <lhofhansl@yahoo.com>2018-07-08 13:30:55 -0700
committerParamat <paramat@users.noreply.github.com>2018-07-08 21:30:55 +0100
commit94cd2bfeac073bf0ff0c384e4921c90f281747b0 (patch)
tree8a07ce985e9486b2bd37c1cbb344286cea5fa446 /src/serverenvironment.h
parent334d8c31ee96f2e6a8464c99eecf84793f598fb6 (diff)
downloadminetest-94cd2bfeac073bf0ff0c384e4921c90f281747b0.tar.gz
minetest-94cd2bfeac073bf0ff0c384e4921c90f281747b0.tar.bz2
minetest-94cd2bfeac073bf0ff0c384e4921c90f281747b0.zip
Revert 6587 - Optimize entity-entity collision (#7539)
Diffstat (limited to 'src/serverenvironment.h')
-rw-r--r--src/serverenvironment.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/serverenvironment.h b/src/serverenvironment.h
index 05a68cb30..225f788d9 100644
--- a/src/serverenvironment.h
+++ b/src/serverenvironment.h
@@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "activeobject.h"
#include "environment.h"
#include "mapnode.h"
-#include "server/serveractiveobjectmap.h"
#include "settings.h"
#include "util/numeric.h"
#include <set>
@@ -194,6 +193,8 @@ enum ClearObjectsMode {
This is not thread-safe. Server uses an environment mutex.
*/
+typedef std::unordered_map<u16, ServerActiveObject *> ServerActiveObjectMap;
+
class ServerEnvironment : public Environment
{
public:
@@ -253,7 +254,18 @@ public:
*/
u16 addActiveObject(ServerActiveObject *object);
- void updateActiveObject(ServerActiveObject *object);
+ /**
+ * Verify if id is a free active object id
+ * @param id
+ * @return true if slot is free
+ */
+ bool isFreeServerActiveObjectId(u16 id) const;
+
+ /**
+ * Retrieve the first free ActiveObject ID
+ * @return free activeobject ID or 0 if none was found
+ */
+ u16 getFreeServerActiveObjectId();
/*
Add an active object as a static object to the corresponding